<commit_before>open OUnit
open Ruby
open Syntax

let _ = run_test_tt_main begin "cpp.ml" >::: [

  "test_gen_retval'" >:: begin fun() ->
    assert_equal "@cli.call(:func)" (gen_retval' "func" []);
    assert_equal "@cli.call(:func, arg1)" (gen_retval' "func" ["arg1"]);
    assert_equal "@cli.call(:func, arg1, arg2)" (gen_retval' "func" ["arg1"; "arg2"]);
  end;

  "test_gen_def" >:: begin fun() ->
    assert_equal "def func" (gen_def "func" []);
    assert_equal "def func(arg1)" (gen_def "func" ["arg1"]);
    assert_equal "def func(arg1, arg2)" (gen_def "func" ["arg1"; "arg2"])
  end;

] end<commit_msg>Write test for gen_retval<commit_after>open OUnit
open Ruby
open Syntax

let _ = run_test_tt_main begin "cpp.ml" >::: [

  "test_gen_retval'" >:: begin fun() ->
    assert_equal "@cli.call(:func)" (gen_retval' "func" []);
    assert_equal "@cli.call(:func, arg1)" (gen_retval' "func" ["arg1"]);
    assert_equal "@cli.call(:func, arg1, arg2)" (gen_retval' "func" ["arg1"; "arg2"]);
  end;

  "test_gen_retval" >:: begin fun() ->
    assert_equal
      "T.from_tuple(@cli.call(:func))"
      (gen_retval "func" [] (Some (Struct "t")));
    assert_equal
      "@cli.call(:func)"
      (gen_retval "func" [] (Some String));
    assert_equal
      "@cli.call(:func)"
      (gen_retval "func" [] None);
  end;

  "test_gen_def" >:: begin fun() ->
    assert_equal "def func" (gen_def "func" []);
    assert_equal "def func(arg1)" (gen_def "func" ["arg1"]);
    assert_equal "def func(arg1, arg2)" (gen_def "func" ["arg1"; "arg2"])
  end;

] end
{'fraction_non_alphanumeric': 0.20451612903225808, 'fraction_numerical': 0.015483870967741935, 'mean_word_length': 4.085245901639344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4250308', 'n_tokens_mistral': 600, 'n_tokens_neox': 590, 'n_words': 136}