trackler 2.0.8.22 → 2.0.8.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/csharp/exercises/accumulate/HINTS.md +1 -2
  4. data/tracks/csharp/exercises/nth-prime/HINTS.md +7 -0
  5. data/tracks/csharp/exercises/proverb/HINTS.md +3 -0
  6. data/tracks/go/exercises/trinary/trinary_test.go +1 -1
  7. data/tracks/go/exercises/twelve-days/twelve_days_test.go +6 -6
  8. data/tracks/java/.Rhistory +0 -0
  9. data/tracks/java/config.json +12 -0
  10. data/tracks/java/exercises/book-store/build.gradle +17 -0
  11. data/tracks/java/exercises/book-store/src/example/java/.keep +0 -0
  12. data/tracks/java/exercises/book-store/src/example/java/Bookstore.java +61 -0
  13. data/tracks/java/exercises/book-store/src/main/java/.keep +0 -0
  14. data/tracks/java/exercises/book-store/src/test/java/.keep +0 -0
  15. data/tracks/java/exercises/book-store/src/test/java/BookstoreTest.java +117 -0
  16. data/tracks/java/exercises/hamming/src/example/java/Hamming.java +11 -2
  17. data/tracks/java/exercises/hamming/src/test/java/HammingTest.java +9 -10
  18. data/tracks/java/exercises/isogram/build.gradle +17 -0
  19. data/tracks/java/exercises/isogram/src/example/java/IsogramChecker.java +34 -0
  20. data/tracks/java/exercises/isogram/src/main/java/.keep +0 -0
  21. data/tracks/java/exercises/isogram/src/test/java/IsogramTest.java +80 -0
  22. data/tracks/java/exercises/raindrops/src/example/java/{Raindrops.java → RaindropConverter.java} +2 -2
  23. data/tracks/java/exercises/raindrops/src/test/java/{RaindropsTest.java → RaindropConverterTest.java} +3 -3
  24. data/tracks/java/exercises/settings.gradle +2 -0
  25. data/tracks/ocaml/.vscode/launch.json +13 -0
  26. data/tracks/ocaml/config.json +5 -0
  27. data/tracks/ocaml/exercises/beer-song/test.ml +15 -7
  28. data/tracks/ocaml/exercises/phone-number/test.ml +2 -2
  29. data/tracks/ocaml/exercises/prime-factors/test.ml +20 -16
  30. data/tracks/ocaml/exercises/roman-numerals/test.ml +40 -22
  31. data/tracks/ocaml/exercises/run-length-encoding/test.ml +6 -4
  32. data/tracks/ocaml/exercises/space-age/test.ml +20 -35
  33. data/tracks/ocaml/exercises/triangle/.merlin +5 -0
  34. data/tracks/ocaml/exercises/triangle/Makefile +11 -0
  35. data/tracks/ocaml/exercises/triangle/example.ml +17 -0
  36. data/tracks/ocaml/exercises/triangle/test.ml +48 -0
  37. data/tracks/ocaml/exercises/triangle/triangle.mli +5 -0
  38. data/tracks/ocaml/tools/test-generator/.merlin +0 -1
  39. data/tracks/ocaml/tools/test-generator/Makefile +3 -0
  40. data/tracks/ocaml/tools/test-generator/src/codegen.ml +1 -1
  41. data/tracks/ocaml/tools/test-generator/src/controller.ml +22 -10
  42. data/tracks/ocaml/tools/test-generator/src/debug.ml +12 -0
  43. data/tracks/ocaml/tools/test-generator/src/special_cases.ml +8 -0
  44. data/tracks/ocaml/tools/test-generator/src/template.ml +91 -41
  45. data/tracks/ocaml/tools/test-generator/src/test_gen.ml +2 -1
  46. data/tracks/ocaml/tools/test-generator/templates/atbash-cipher/template.ml +11 -3
  47. data/tracks/ocaml/tools/test-generator/templates/beer-song/template.ml +13 -3
  48. data/tracks/ocaml/tools/test-generator/templates/difference-of-squares/template.ml +17 -3
  49. data/tracks/ocaml/tools/test-generator/templates/prime-factors/template.ml +25 -0
  50. data/tracks/ocaml/tools/test-generator/templates/roman-numerals/template.ml +15 -0
  51. data/tracks/ocaml/tools/test-generator/templates/run-length-encoding/template.ml +19 -3
  52. data/tracks/ocaml/tools/test-generator/templates/space-age/template.ml +19 -0
  53. data/tracks/ocaml/tools/test-generator/templates/triangle/template.ml +33 -0
  54. data/tracks/ocaml/tools/test-generator/test/template_test.ml +8 -7
  55. data/tracks/powershell/exercises/hamming/hamming.tests.ps1 +4 -4
  56. metadata +28 -4
@@ -4,64 +4,114 @@ open Codegen
4
4
  open Utils
5
5
 
6
6
  (* start and finish are the lines where the generated code should be copied *)
7
- type t = {start: int;
8
- finish: int;
9
- file_text: string;
10
- template: string;
11
- suite_name_line: int option;
12
- suite_end: int option;
13
- suite_all_names_line: int option;
7
+ type template_part = {
8
+ start: int;
9
+ finish: int;
10
+ template: string;
11
+ } [@@deriving eq, show]
12
+
13
+ type suite = {
14
+ template_part: template_part;
15
+ suite_name_line: int;
16
+ suite_end: int;
17
+ } [@@deriving eq, show]
18
+
19
+ type template =
20
+ Single of template_part
21
+ | Multi of (suite list) [@@deriving eq, show]
22
+
23
+ type t = {file_text: string;
24
+ template: template;
14
25
  } [@@deriving eq, show]
15
26
 
16
27
  let find_template ~(template_text: string): t option =
17
28
  let open Option.Monad_infix in
18
- let str_contains pattern s = String.substr_index s ~pattern |> Option.is_some in
19
29
  let lines = String.split_lines template_text |> List.to_array in
20
- let suite_end = find_arrayi lines ~f:(str_contains "(* END SUITE *)") |> Option.map ~f:fst in
21
- let start_index = find_arrayi lines ~f:(str_contains "(* TEST") |> Option.map ~f:fst in
22
- let finish_index = (start_index >>= (fun start -> find_arrayi ~start lines ~f:(str_contains "END TEST *"))) |> Option.map ~f:fst in
23
- let template_lines = Option.map2 start_index finish_index (fun s -> Array.slice lines (s+1)) in
24
- let suite_name_line = find_arrayi lines ~f:(str_contains "(* SUITE *)$(suite_name)") |> Option.map ~f:fst in
25
- let suite_all_names_line = find_arrayi lines ~f:(str_contains "(* suite-all-names *)") |> Option.map ~f:fst in
26
- Option.map2 start_index template_lines ~f:(fun s l -> {start=s;
27
- finish=(s + 1 + Array.length l);
28
- file_text = template_text;
29
- template=String.concat_array l ~sep:"\n";
30
- suite_name_line = suite_name_line;
31
- suite_end = suite_end;
32
- suite_all_names_line = suite_all_names_line
33
- })
30
+ let test_starts = Array.filter_mapi lines ~f:(fun i l -> if (String.is_substring l ~substring:"(* TEST") then Some i else None) in
31
+ let test_ends = Array.filter_mapi lines ~f:(fun i l -> if (String.is_substring l ~substring:"END TEST") then Some i else None) in
32
+ let test_starts_and_ends = Array.zip_exn test_starts test_ends in
33
+ let template_lines = Array.map test_starts_and_ends ~f:(fun (s,e) -> Array.slice lines (s+1) e) in
34
+ let suite_name_lines = Array.filter_mapi lines ~f:(fun i l -> if (String.is_prefix l ~prefix:"let (* SUITE ") then Some i else None) in
35
+ let suite_ends = Array.filter_mapi lines ~f:(fun i l -> if (String.is_prefix l ~prefix:"(* END SUITE *)") then Some i else None) in
36
+ if Array.is_empty suite_name_lines || Array.is_empty suite_ends
37
+ then
38
+ if Array.is_empty test_starts || Array.is_empty test_ends
39
+ then None
40
+ else
41
+ Some {
42
+ file_text = template_text;
43
+ template = Single {start = test_starts.(0); finish = test_ends.(0); template = String.concat_array ~sep:"\n" (template_lines.(0))}
44
+ }
45
+ else
46
+ let suites = Array.mapi suite_name_lines ~f:(fun i sn -> {
47
+ template_part =
48
+ {
49
+ start = test_starts.(i);
50
+ finish = test_ends.(i);
51
+ template = template_lines.(i) |> String.concat_array ~sep:"\n";
52
+ };
53
+ suite_name_line = suite_name_lines.(i);
54
+ suite_end =suite_ends.(i);
55
+ }) |> Array.to_list in
56
+ Some {
57
+ file_text = template_text;
58
+ template = Multi suites
59
+ }
34
60
 
35
- let fill_tests (template: t) (substs: subst list): string =
36
- let lines = String.split_lines template.file_text |> List.to_array in
61
+ let fill_tests (file_text: string) (template: template_part) (substs: subst list): string =
62
+ let lines = String.split_lines file_text |> List.to_array in
37
63
  let before = Array.slice lines 0 template.start in
38
64
  let subst = Array.of_list (List.map ~f:subst_to_string substs) in
39
65
  let after = Array.slice lines (template.finish + 1) (Array.length lines) in
40
66
  let join = String.concat_array ~sep:"\n" in
41
67
  String.concat [join before; join subst; join after] ~sep:"\n"
42
68
 
43
- let fill_single_suite (template: t) (suite_substs: string * subst list): (string, string) Result.t =
69
+ let array_drop n xs =
70
+ Array.slice xs n (Array.length xs)
71
+
72
+ let list_drop_right n xs =
73
+ List.slice xs 0 (List.length xs - n)
74
+
75
+ let fill_single_suite (file_lines: string array) (suite: suite) (suite_substs: string * subst list): (string, string) Result.t =
44
76
  let open Result.Monad_infix in
45
77
  let (suite_name, substs) = suite_substs in
46
- Result.of_option template.suite_name_line ~error:"no suite name" >>= fun suite_name_line ->
47
- Result.of_option template.suite_end ~error:"no suite end" >>= fun suite_end_line ->
48
- let lines = String.split_lines template.file_text |> Fn.flip List.drop suite_name_line |> List.to_array in
49
- Array.replace lines 0 ~f:(String.substr_replace_all ~pattern:"(* SUITE *)$(suite_name)_tests" ~with_:(suite_name ^ "_tests"));
50
- let before = Array.slice lines 0 (template.start - suite_name_line) in
78
+ let suite_name_line = suite.suite_name_line in
79
+ let suite_end = suite.suite_end in
80
+ let lines = array_drop suite_name_line file_lines in
81
+ Array.replace lines 0 ~f:(String.substr_replace_all ~pattern:("(* SUITE " ^ suite_name ^ " *)") ~with_:"");
82
+ let before = Array.slice lines 0 (suite.template_part.start - suite_name_line) in
51
83
  let subst = Array.of_list (List.map ~f:subst_to_string substs) in
52
- let after = Array.slice lines (template.finish - suite_name_line + 1) (suite_end_line - suite_name_line) in
84
+ let after = Array.slice lines (suite.template_part.finish - suite_name_line + 1) (suite_end - suite_name_line) in
53
85
  let join = String.concat_array ~sep:"\n" in
54
86
  Result.return @@ (String.concat [join before; join subst; join after] ~sep:"\n") ^ "\n"
55
87
 
88
+ let matches_suite_name file_lines suite suite_name =
89
+ let line = file_lines.(suite.suite_name_line) in
90
+ String.is_substring line ~substring:suite_name
91
+
92
+ let to_single = function
93
+ | (Single s) -> s
94
+ | _ -> failwith "bug"
95
+
96
+ let to_multi = function
97
+ | Multi suites -> suites
98
+ | _ -> failwith "unexpected case"
99
+
56
100
  let fill_suite (template: t) (suite_substs: (string * subst list) list): (string, string) Result.t =
101
+ let file_lines = String.split_lines template.file_text |> List.to_array in
57
102
  let open Result.Monad_infix in
58
- List.map suite_substs ~f:(fun x -> (fill_single_suite template x)) |> sequence >>= fun fills ->
59
- Result.of_option template.suite_name_line "no suite name line" >>= fun suite_name_line ->
60
- let lines = String.split_lines template.file_text |> List.to_array in
61
- let before = Array.slice lines 0 suite_name_line in
62
- let subst = Array.of_list fills in
63
- let after = Array.slice lines (template.finish + 4) (Array.length lines) in
64
- let join = String.concat_array ~sep:"\n" in
65
- let generated = String.concat [join before; join subst; join after] ~sep:"\n" in
66
- let all_suite_names = String.concat ~sep:"; " @@ List.map ~f:(fun (s,_) -> s ^ "_tests") suite_substs in
67
- Result.return @@ String.substr_replace_all generated ~pattern:"(* suite-all-names *)" ~with_:all_suite_names
103
+ let suites = to_multi template.template in
104
+ let fill_1_suite text (line, suite): (string, string) Result.t =
105
+ let suite_subst = List.find_exn suite_substs ~f:(fun (suite_name,_) -> matches_suite_name file_lines suite suite_name) in
106
+ fill_single_suite file_lines suite suite_subst >>= fun subst ->
107
+ let suite_name_line = suite.suite_name_line in
108
+ let before = Array.slice file_lines line suite_name_line |> String.concat_array ~sep:"\n" in
109
+ let generated = before ^ "\n" ^ subst in
110
+ Ok generated
111
+ in
112
+ let lines = List.rev_map suites ~f:(fun s -> 1 + s.suite_end) |> List.tl_exn |> List.rev |> List.cons 0 in
113
+ let lines_and_suites = List.zip_exn lines suites in
114
+ List.map lines_and_suites ~f:(fill_1_suite template.file_text) |> sequence |> Result.map ~f:(String.concat ~sep:"\n") >>= fun all_but_last_part ->
115
+ let last_suite_line = (List.last_exn suites).suite_end + 1 in
116
+ let last_part = Array.slice file_lines last_suite_line (Array.length file_lines) |> String.concat_array ~sep:"\n" in
117
+ Ok (all_but_last_part ^ last_part)
@@ -21,8 +21,9 @@ let command =
21
21
  +> flag "-c" (optional_with_default "../../../x-common/exercises" is_directory) ~doc:"string Directory containing canonical data."
22
22
  +> flag "-o" (optional_with_default "../../exercises" is_directory) ~doc:"string Directory to output generated tests."
23
23
  +> flag "-g" (optional_with_default (home_dir ^ "/.xocaml-generated") is_directory) ~doc:"string Directory to backup generated tests."
24
+ +> flag "-f" (optional string) ~doc:"string Filter out files not matching this string."
24
25
  )
25
- (fun templates_folder canonical_data_folder output_folder generated_folder () -> Controller.run templates_folder canonical_data_folder output_folder generated_folder)
26
+ (fun templates_folder canonical_data_folder output_folder generated_folder filter () -> Controller.run templates_folder canonical_data_folder output_folder generated_folder filter)
26
27
 
27
28
  let () =
28
29
  Command.run ~version:"0.1" command
@@ -4,10 +4,18 @@ open Atbash_cipher
4
4
 
5
5
  let ae exp got _test_ctxt = assert_equal ~printer:String.to_string exp got
6
6
 
7
- let (* SUITE *)$(suite_name)_tests = [
7
+ let (* SUITE encode *)encode_tests = [
8
8
  (* TEST
9
9
  "$description" >::
10
- ae $expected ($suite-name $phrase);
10
+ ae $expected (encode $phrase);
11
+ END TEST *)
12
+ ]
13
+ (* END SUITE *)
14
+
15
+ let (* SUITE decode *)decode_tests = [
16
+ (* TEST
17
+ "$description" >::
18
+ ae $expected (decode $phrase);
11
19
  END TEST *)
12
20
  ]
13
21
  (* END SUITE *)
@@ -20,5 +28,5 @@ let different_block_size_test = [
20
28
  let () =
21
29
  run_test_tt_main (
22
30
  "atbash-cipher tests" >:::
23
- List.concat [(* suite-all-names *); different_block_size_test]
31
+ List.concat [encode_tests; decode_tests; different_block_size_test]
24
32
  )
@@ -23,10 +23,20 @@ let zip s1 s2 =
23
23
  then ()
24
24
  else failwith @@ "Expected differs from actual: " ^ (diff_message exp got)
25
25
 
26
- let (* SUITE *)$(suite_name)_tests = [
26
+ let (* SUITE verse *)verse_tests = [
27
27
  (* TEST
28
28
  "$description" >::
29
- ae $expected ($suite-name $number);
29
+ ae $expected
30
+ (verse $number);
31
+ END TEST *)
32
+ ]
33
+ (* END SUITE *)
34
+
35
+ let (* SUITE lyrics *)lyrics_tests = [
36
+ (* TEST
37
+ "$description" >::
38
+ ae $expected
39
+ (lyrics ~from:$beginning ~until:$end);
30
40
  END TEST *)
31
41
  ]
32
42
  (* END SUITE *)
@@ -34,5 +44,5 @@ let (* SUITE *)$(suite_name)_tests = [
34
44
  let () =
35
45
  run_test_tt_main (
36
46
  "beer song tests" >:::
37
- List.concat [(* suite-all-names *)]
47
+ List.concat [verse_tests; lyrics_tests]
38
48
  )
@@ -4,10 +4,24 @@ open Difference_of_squares
4
4
 
5
5
  let ae exp got _test_ctxt = assert_equal exp got
6
6
 
7
- let (* SUITE *)$(suite_name)_tests = [
7
+ let (* SUITE square_the_sum_of_the_numbers_up_to_the_given_number *)square_of_sum_tests = [
8
8
  (* TEST
9
9
  "$description" >::
10
- ae $expected ($suite-name $number);
10
+ ae $expected (square_of_sum $number);
11
+ END TEST *)
12
+ ]
13
+ (* END SUITE *)
14
+ let (* SUITE sum_the_squares_of_the_numbers_up_to_the_given_number *)sum_of_squares_tests = [
15
+ (* TEST
16
+ "$description" >::
17
+ ae $expected (sum_of_squares $number);
18
+ END TEST *)
19
+ ]
20
+ (* END SUITE *)
21
+ let (* SUITE subtract_sum_of_squares_from_square_of_sums *)difference_of_squares_tests = [
22
+ (* TEST
23
+ "$description" >::
24
+ ae $expected (difference_of_squares $number);
11
25
  END TEST *)
12
26
  ]
13
27
  (* END SUITE *)
@@ -15,5 +29,5 @@ let (* SUITE *)$(suite_name)_tests = [
15
29
  let () =
16
30
  run_test_tt_main (
17
31
  "difference of squares tests" >:::
18
- List.concat [(* suite-all-names *)]
32
+ List.concat [square_of_sum_tests; sum_of_squares_tests; difference_of_squares_tests]
19
33
  )
@@ -0,0 +1,25 @@
1
+ open Core.Std
2
+ open OUnit2
3
+ open Prime_factors
4
+
5
+ (* Assert Equals *)
6
+ let ae exp got _test_ctxt =
7
+ let printer = List.to_string ~f:Int64.to_string in
8
+ assert_equal exp got ~printer
9
+
10
+ let to_int64s = List.map ~f:Int64.of_int
11
+
12
+ (* 64 bits integers are needed for the last number.
13
+ *
14
+ * If you happen to use a 64 bits machine normal ints would do as well, but this
15
+ * works for everybody.
16
+ *)
17
+ let tests = [
18
+ (* TEST
19
+ "$description" >::
20
+ ae (to_int64s $expected) (factors_of $(input)L);
21
+ END TEST *)
22
+ ]
23
+
24
+ let () =
25
+ run_test_tt_main ("prime-factors tests" >::: tests)
@@ -0,0 +1,15 @@
1
+ open Core.Std
2
+ open OUnit2
3
+ open Roman_numerals
4
+
5
+ let ae expected actual _ctx = assert_equal ~printer:Fn.id expected actual
6
+
7
+ let tests = [
8
+ (* TEST
9
+ "$description" >::
10
+ ae $expected (to_roman $number);
11
+ END TEST *)
12
+ ]
13
+
14
+ let () =
15
+ run_test_tt_main ("roman-numerals test" >::: tests)
@@ -4,10 +4,26 @@ open Run_length_encoding
4
4
 
5
5
  let ae exp got _test_ctxt = assert_equal exp got ~printer:Fn.id
6
6
 
7
- let (* SUITE *)$(suite_name)_tests = [
7
+ let (* SUITE run-length_encode_a_string *)encode_tests = [
8
8
  (* TEST
9
9
  "$description" >::
10
- ae $expected ($suite-name $input);
10
+ ae $expected (encode $input);
11
+ END TEST *)
12
+ ]
13
+ (* END SUITE *)
14
+
15
+ let (* SUITE run-length_decode_a_string *)decode_tests = [
16
+ (* TEST
17
+ "$description" >::
18
+ ae $expected (decode $input);
19
+ END TEST *)
20
+ ]
21
+ (* END SUITE *)
22
+
23
+ let (* SUITE encode_and_then_decode *)encode_and_then_decode_tests = [
24
+ (* TEST
25
+ "$description" >::
26
+ ae $expected (encode $input |> decode);
11
27
  END TEST *)
12
28
  ]
13
29
  (* END SUITE *)
@@ -15,5 +31,5 @@ let (* SUITE *)$(suite_name)_tests = [
15
31
  let () =
16
32
  run_test_tt_main (
17
33
  "run length encoding tests" >:::
18
- List.concat [(* suite-all-names *)]
34
+ List.concat [encode_tests; decode_tests; encode_and_then_decode_tests]
19
35
  )
@@ -0,0 +1,19 @@
1
+ open Core.Std
2
+ open OUnit2
3
+ open Space_age
4
+
5
+ (* Assert In Delta *)
6
+ let ae ~delta:delta exp got _ctxt =
7
+ let msg = sprintf "Expected %f got %f, difference is greater than %f"
8
+ exp got delta in
9
+ assert_bool msg (cmp_float ~epsilon:delta exp got)
10
+
11
+ let tests = [
12
+ (* TEST
13
+ "$description" >::
14
+ ae ~delta:0.005 $expected (age_on $planet $seconds);
15
+ END TEST *)
16
+ ]
17
+
18
+ let () =
19
+ run_test_tt_main ("space-age tests" >::: tests)
@@ -0,0 +1,33 @@
1
+ open Core.Std
2
+ open OUnit2
3
+ open Triangle
4
+
5
+ let ae exp got _test_ctxt = assert_equal exp got ~printer:Bool.to_string
6
+
7
+ let (* SUITE returns_true_if_the_triangle_is_equilateral *)equilateral_tests = [
8
+ (* TEST
9
+ "$description" >::
10
+ ae $expected (is_equilateral $sides);
11
+ END TEST *)
12
+ ]
13
+ (* END SUITE *)
14
+ let (* SUITE returns_true_if_the_triangle_is_isosceles *)isoceles_tests = [
15
+ (* TEST
16
+ "$description" >::
17
+ ae $expected (is_isoceles $sides);
18
+ END TEST *)
19
+ ]
20
+ (* END SUITE *)
21
+ let (* SUITE returns_true_if_the_triangle_is_scalene *)scalene_tests = [
22
+ (* TEST
23
+ "$description" >::
24
+ ae $expected (is_scalene $sides);
25
+ END TEST *)
26
+ ]
27
+ (* END SUITE *)
28
+
29
+ let () =
30
+ run_test_tt_main (
31
+ "triangle tests" >:::
32
+ List.concat [equilateral_tests; isoceles_tests; scalene_tests]
33
+ )
@@ -13,14 +13,15 @@ let template_tests = [
13
13
 
14
14
  "if there is a test marker in a string then find_template returns where it is" >:: (fun _ctx ->
15
15
  let template_text = In_channel.read_all "test/sample_template.txt" in
16
- assert_equal ~printer (Some {start=7; finish=9;
17
- file_text=template_text; template="code";
18
- suite_name_line= None;
19
- suite_end = None;
20
- suite_all_names_line = None}) @@ find_template ~template_text
16
+ let expected_single = Single {
17
+ start = 7;
18
+ finish = 9;
19
+ template = "code";
20
+ } in
21
+ assert_equal ~printer (Some {file_text = template_text; template = expected_single}) @@ find_template ~template_text
21
22
  );
22
23
 
23
- "if there is a suite description line then find_template returns where it is" >:: (fun _ctx ->
24
+ (*"if there is a suite description line then find_template returns where it is" >:: (fun _ctx ->
24
25
  let template_text = In_channel.read_all "test/sample-suite-template.txt" in
25
26
  let template = find_template ~template_text in
26
27
  match template with
@@ -56,5 +57,5 @@ let template_tests = [
56
57
  assert_equal ~printer:Bool.to_string true (String.substr_index filled ~pattern:"line1" |> Option.is_some);
57
58
  assert_equal ~printer:Bool.to_string true (String.substr_index filled ~pattern:"line2" |> Option.is_some);
58
59
  assert_equal ~printer:Int.to_string 7 (String.count ~f:(fun ch -> ch = '\n') filled);
59
- );
60
+ );*)
60
61
  ]
@@ -9,7 +9,7 @@ Describe "HammingTest" {
9
9
  It "tests log identical strands" {
10
10
  Compute "GGACTGA" "GGACTGA" | Should be 0
11
11
  }
12
-
12
+
13
13
  It "tests complete distance in single nucleotide strands" {
14
14
  Compute "A" "G" | Should be 1
15
15
  }
@@ -37,7 +37,7 @@ Describe "HammingTest" {
37
37
  It "tests non unique character in second strand" {
38
38
  Compute "AGG" "AGA" | Should be 1
39
39
  }
40
-
40
+
41
41
  It "tests same nucleotides in different position" {
42
42
  Compute "TAG" "GAT" | Should be 2
43
43
  }
@@ -45,7 +45,7 @@ Describe "HammingTest" {
45
45
  It "tests large distance" {
46
46
  Compute "GATACA" "GCATAA" | Should be 4
47
47
  }
48
-
48
+
49
49
  It "tests large distance in off by one strand" {
50
50
  Compute "GGACGGATTCTG" "AGGACGGATTCT" | Should be 9
51
51
  }
@@ -59,6 +59,6 @@ Describe "HammingTest" {
59
59
  }
60
60
 
61
61
  It "tests disallow second strand longer" {
62
- { Compute("ATA", "AGTG") } | Should Throw "Mismatching string lengths"
62
+ { Compute "ATA" "AGTG" } | Should Throw "Mismatching string lengths"
63
63
  }
64
64
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8.22
4
+ version: 2.0.8.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -1598,6 +1598,7 @@ files:
1598
1598
  - tracks/csharp/exercises/minesweeper/Minesweeper.csproj
1599
1599
  - tracks/csharp/exercises/minesweeper/MinesweeperTest.cs
1600
1600
  - tracks/csharp/exercises/nth-prime/Example.cs
1601
+ - tracks/csharp/exercises/nth-prime/HINTS.md
1601
1602
  - tracks/csharp/exercises/nth-prime/NthPrime.cs
1602
1603
  - tracks/csharp/exercises/nth-prime/NthPrime.csproj
1603
1604
  - tracks/csharp/exercises/nth-prime/NthPrimeTest.cs
@@ -1654,6 +1655,7 @@ files:
1654
1655
  - tracks/csharp/exercises/protein-translation/ProteinTranslation.csproj
1655
1656
  - tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs
1656
1657
  - tracks/csharp/exercises/proverb/Example.cs
1658
+ - tracks/csharp/exercises/proverb/HINTS.md
1657
1659
  - tracks/csharp/exercises/proverb/Proverb.cs
1658
1660
  - tracks/csharp/exercises/proverb/Proverb.csproj
1659
1661
  - tracks/csharp/exercises/proverb/ProverbTest.cs
@@ -4132,6 +4134,7 @@ files:
4132
4134
  - tracks/idris/exercises/leap/src/example.idr
4133
4135
  - tracks/idris/img/.keep
4134
4136
  - tracks/idris/img/icon.png
4137
+ - tracks/java/.Rhistory
4135
4138
  - tracks/java/.git
4136
4139
  - tracks/java/.gitignore
4137
4140
  - tracks/java/.keep
@@ -4206,6 +4209,12 @@ files:
4206
4209
  - tracks/java/exercises/bob/src/example/java/Bob.java
4207
4210
  - tracks/java/exercises/bob/src/main/java/.keep
4208
4211
  - tracks/java/exercises/bob/src/test/java/BobTest.java
4212
+ - tracks/java/exercises/book-store/build.gradle
4213
+ - tracks/java/exercises/book-store/src/example/java/.keep
4214
+ - tracks/java/exercises/book-store/src/example/java/Bookstore.java
4215
+ - tracks/java/exercises/book-store/src/main/java/.keep
4216
+ - tracks/java/exercises/book-store/src/test/java/.keep
4217
+ - tracks/java/exercises/book-store/src/test/java/BookstoreTest.java
4209
4218
  - tracks/java/exercises/bracket-push/build.gradle
4210
4219
  - tracks/java/exercises/bracket-push/src/example/java/BracketChecker.java
4211
4220
  - tracks/java/exercises/bracket-push/src/main/java/BracketChecker.java
@@ -4267,6 +4276,10 @@ files:
4267
4276
  - tracks/java/exercises/hexadecimal/src/example/java/Hexadecimal.java
4268
4277
  - tracks/java/exercises/hexadecimal/src/main/java/.keep
4269
4278
  - tracks/java/exercises/hexadecimal/src/test/java/HexadecimalTest.java
4279
+ - tracks/java/exercises/isogram/build.gradle
4280
+ - tracks/java/exercises/isogram/src/example/java/IsogramChecker.java
4281
+ - tracks/java/exercises/isogram/src/main/java/.keep
4282
+ - tracks/java/exercises/isogram/src/test/java/IsogramTest.java
4270
4283
  - tracks/java/exercises/largest-series-product/build.gradle
4271
4284
  - tracks/java/exercises/largest-series-product/src/example/java/LargestSeriesProductCalculator.java
4272
4285
  - tracks/java/exercises/largest-series-product/src/main/java/LargestSeriesProductCalculator.java
@@ -4354,9 +4367,9 @@ files:
4354
4367
  - tracks/java/exercises/queen-attack/src/main/java/QueenAttackCalculator.java
4355
4368
  - tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java
4356
4369
  - tracks/java/exercises/raindrops/build.gradle
4357
- - tracks/java/exercises/raindrops/src/example/java/Raindrops.java
4370
+ - tracks/java/exercises/raindrops/src/example/java/RaindropConverter.java
4358
4371
  - tracks/java/exercises/raindrops/src/main/java/.keep
4359
- - tracks/java/exercises/raindrops/src/test/java/RaindropsTest.java
4372
+ - tracks/java/exercises/raindrops/src/test/java/RaindropConverterTest.java
4360
4373
  - tracks/java/exercises/rectangles/build.gradle
4361
4374
  - tracks/java/exercises/rectangles/src/example/java/RectangleCounter.java
4362
4375
  - tracks/java/exercises/rectangles/src/main/java/RectangleCounter.java
@@ -5650,6 +5663,7 @@ files:
5650
5663
  - tracks/ocaml/.gitignore
5651
5664
  - tracks/ocaml/.travis-ci.sh
5652
5665
  - tracks/ocaml/.travis.yml
5666
+ - tracks/ocaml/.vscode/launch.json
5653
5667
  - tracks/ocaml/LICENSE
5654
5668
  - tracks/ocaml/Makefile
5655
5669
  - tracks/ocaml/README.md
@@ -5833,6 +5847,11 @@ files:
5833
5847
  - tracks/ocaml/exercises/space-age/example.ml
5834
5848
  - tracks/ocaml/exercises/space-age/space_age.mli
5835
5849
  - tracks/ocaml/exercises/space-age/test.ml
5850
+ - tracks/ocaml/exercises/triangle/.merlin
5851
+ - tracks/ocaml/exercises/triangle/Makefile
5852
+ - tracks/ocaml/exercises/triangle/example.ml
5853
+ - tracks/ocaml/exercises/triangle/test.ml
5854
+ - tracks/ocaml/exercises/triangle/triangle.mli
5836
5855
  - tracks/ocaml/exercises/word-count/.merlin
5837
5856
  - tracks/ocaml/exercises/word-count/Makefile
5838
5857
  - tracks/ocaml/exercises/word-count/example.ml
@@ -5854,6 +5873,7 @@ files:
5854
5873
  - tracks/ocaml/tools/test-generator/src/canonical_data_checker.ml
5855
5874
  - tracks/ocaml/tools/test-generator/src/codegen.ml
5856
5875
  - tracks/ocaml/tools/test-generator/src/controller.ml
5876
+ - tracks/ocaml/tools/test-generator/src/debug.ml
5857
5877
  - tracks/ocaml/tools/test-generator/src/files.ml
5858
5878
  - tracks/ocaml/tools/test-generator/src/model.ml
5859
5879
  - tracks/ocaml/tools/test-generator/src/parser.ml
@@ -5877,9 +5897,13 @@ files:
5877
5897
  - tracks/ocaml/tools/test-generator/templates/minesweeper/template.ml
5878
5898
  - tracks/ocaml/tools/test-generator/templates/pangram/template.ml
5879
5899
  - tracks/ocaml/tools/test-generator/templates/phone-number/template.ml
5900
+ - tracks/ocaml/tools/test-generator/templates/prime-factors/template.ml
5880
5901
  - tracks/ocaml/tools/test-generator/templates/raindrops/template.ml
5902
+ - tracks/ocaml/tools/test-generator/templates/roman-numerals/template.ml
5881
5903
  - tracks/ocaml/tools/test-generator/templates/run-length-encoding/template.ml
5882
5904
  - tracks/ocaml/tools/test-generator/templates/say/template.ml
5905
+ - tracks/ocaml/tools/test-generator/templates/space-age/template.ml
5906
+ - tracks/ocaml/tools/test-generator/templates/triangle/template.ml
5883
5907
  - tracks/ocaml/tools/test-generator/templates/word-count/template.ml
5884
5908
  - tracks/ocaml/tools/test-generator/test/all_tests.ml
5885
5909
  - tracks/ocaml/tools/test-generator/test/beer-song.json