trackler 2.2.1.108 → 2.2.1.109

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/java/exercises/hamming/.meta/version +1 -1
  4. data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -1
  5. data/tracks/java/exercises/rotational-cipher/.meta/version +1 -1
  6. data/tracks/java/exercises/scrabble-score/.meta/version +1 -1
  7. data/tracks/java/exercises/secret-handshake/.meta/version +1 -1
  8. data/tracks/java/exercises/twelve-days/.meta/version +1 -1
  9. data/tracks/ocaml/tools/test-generator/src/model.ml +21 -0
  10. data/tracks/ocaml/tools/test-generator/src/ocaml_special_cases.ml +4 -5
  11. data/tracks/ocaml/tools/test-generator/src/parser.ml +16 -4
  12. data/tracks/ocaml/tools/test-generator/src/test_gen.ml +2 -2
  13. data/tracks/ocaml/tools/test-generator/src/utils.ml +1 -1
  14. data/tracks/ocaml/tools/test-generator/templates/ocaml/all-your-base/test.ml +1 -1
  15. data/tracks/ocaml/tools/test-generator/templates/ocaml/bob/test.ml +2 -2
  16. data/tracks/ocaml/tools/test-generator/templates/ocaml/bracket-push/test.ml +1 -1
  17. data/tracks/ocaml/tools/test-generator/templates/ocaml/dominoes/test.ml +1 -1
  18. data/tracks/ocaml/tools/test-generator/templates/ocaml/leap/test.ml +2 -2
  19. data/tracks/ocaml/tools/test-generator/templates/ocaml/luhn/test.ml +1 -1
  20. data/tracks/ocaml/tools/test-generator/templates/ocaml/minesweeper/test.ml +1 -1
  21. data/tracks/ocaml/tools/test-generator/templates/ocaml/palindrome-products/test.ml +1 -1
  22. data/tracks/ocaml/tools/test-generator/templates/ocaml/pangram/test.ml +1 -1
  23. data/tracks/ocaml/tools/test-generator/templates/ocaml/prime-factors/test.ml +1 -1
  24. data/tracks/ocaml/tools/test-generator/templates/ocaml/rectangles/test.ml +1 -1
  25. data/tracks/ocaml/tools/test-generator/templates/ocaml/run-length-encoding/test.ml +3 -3
  26. data/tracks/ocaml/tools/test-generator/templates/ocaml/say/test.ml +1 -1
  27. data/tracks/ocaml/tools/test-generator/templates/ocaml/word-count/test.ml +1 -1
  28. data/tracks/ocaml/tools/test-generator/test/beer-song.json +382 -31
  29. data/tracks/ocaml/tools/test-generator/test/clock.json +484 -333
  30. data/tracks/ocaml/tools/test-generator/test/difference_of_squares.json +38 -26
  31. data/tracks/ocaml/tools/test-generator/test/hello_world.json +12 -18
  32. data/tracks/ocaml/tools/test-generator/test/leap.json +33 -34
  33. data/tracks/ocaml/tools/test-generator/test/parser_test.ml +18 -14
  34. data/tracks/ocaml/tools/test-generator/test/with-methods-key.json +1 -1
  35. data/tracks/rust/exercises/allergies/Cargo.toml +1 -1
  36. data/tracks/rust/exercises/atbash-cipher/Cargo.toml +1 -1
  37. data/tracks/rust/exercises/binary-search/Cargo.toml +1 -1
  38. data/tracks/rust/exercises/bob/Cargo.toml +1 -1
  39. data/tracks/rust/exercises/bracket-push/Cargo.toml +1 -1
  40. data/tracks/rust/exercises/collatz-conjecture/Cargo.toml +1 -1
  41. data/tracks/rust/exercises/difference-of-squares/Cargo.toml +1 -1
  42. data/tracks/rust/exercises/dominoes/Cargo.toml +1 -1
  43. data/tracks/rust/exercises/gigasecond/Cargo.toml +1 -1
  44. data/tracks/rust/exercises/grains/Cargo.toml +1 -1
  45. data/tracks/rust/exercises/hello-world/Cargo.toml +1 -1
  46. data/tracks/rust/exercises/isogram/Cargo.toml +1 -1
  47. data/tracks/rust/exercises/largest-series-product/Cargo.toml +1 -1
  48. data/tracks/rust/exercises/minesweeper/Cargo.toml +1 -1
  49. data/tracks/rust/exercises/pascals-triangle/Cargo.toml +1 -1
  50. data/tracks/rust/exercises/perfect-numbers/Cargo.toml +1 -1
  51. data/tracks/rust/exercises/poker/Cargo.toml +1 -1
  52. data/tracks/rust/exercises/prime-factors/Cargo.toml +1 -1
  53. data/tracks/rust/exercises/queen-attack/Cargo.toml +1 -1
  54. data/tracks/rust/exercises/raindrops/Cargo.toml +1 -1
  55. data/tracks/rust/exercises/react/Cargo.toml +1 -1
  56. data/tracks/rust/exercises/rectangles/Cargo.toml +1 -1
  57. data/tracks/rust/exercises/robot-simulator/Cargo.toml +1 -1
  58. data/tracks/rust/exercises/run-length-encoding/Cargo.toml +1 -1
  59. data/tracks/rust/exercises/saddle-points/Cargo.toml +1 -1
  60. data/tracks/rust/exercises/say/Cargo.toml +1 -1
  61. data/tracks/rust/exercises/scrabble-score/Cargo.toml +1 -1
  62. data/tracks/rust/exercises/sieve/Cargo.toml +1 -1
  63. data/tracks/rust/exercises/space-age/Cargo.toml +1 -1
  64. data/tracks/rust/exercises/tournament/Cargo.toml +1 -1
  65. data/tracks/rust/exercises/variable-length-quantity/Cargo.toml +1 -1
  66. data/tracks/rust/exercises/wordy/Cargo.toml +1 -1
  67. metadata +2 -2
@@ -1,26 +1,32 @@
1
1
  {
2
2
  "exercise": "difference-of-squares",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "cases": [
5
5
  {
6
6
  "description": "Square the sum of the numbers up to the given number",
7
7
  "cases": [
8
8
  {
9
- "description": "square of sum 5",
9
+ "description": "square of sum 1",
10
10
  "property": "squareOfSum",
11
- "number": 5,
12
- "expected": 225
11
+ "input": {
12
+ "number": 1
13
+ },
14
+ "expected": 1
13
15
  },
14
16
  {
15
- "description": "square of sum 10",
17
+ "description": "square of sum 5",
16
18
  "property": "squareOfSum",
17
- "number": 10,
18
- "expected": 3025
19
+ "input": {
20
+ "number": 5
21
+ },
22
+ "expected": 225
19
23
  },
20
24
  {
21
25
  "description": "square of sum 100",
22
26
  "property": "squareOfSum",
23
- "number": 100,
27
+ "input": {
28
+ "number": 100
29
+ },
24
30
  "expected": 25502500
25
31
  }
26
32
  ]
@@ -29,21 +35,27 @@
29
35
  "description": "Sum the squares of the numbers up to the given number",
30
36
  "cases": [
31
37
  {
32
- "description": "sum of squares 5",
38
+ "description": "sum of squares 1",
33
39
  "property": "sumOfSquares",
34
- "number": 5,
35
- "expected": 55
40
+ "input": {
41
+ "number": 1
42
+ },
43
+ "expected": 1
36
44
  },
37
45
  {
38
- "description": "sum of squares 10",
46
+ "description": "sum of squares 5",
39
47
  "property": "sumOfSquares",
40
- "number": 10,
41
- "expected": 385
48
+ "input": {
49
+ "number": 5
50
+ },
51
+ "expected": 55
42
52
  },
43
53
  {
44
54
  "description": "sum of squares 100",
45
55
  "property": "sumOfSquares",
46
- "number": 100,
56
+ "input": {
57
+ "number": 100
58
+ },
47
59
  "expected": 338350
48
60
  }
49
61
  ]
@@ -52,30 +64,30 @@
52
64
  "description": "Subtract sum of squares from square of sums",
53
65
  "cases": [
54
66
  {
55
- "description": "difference of squares 0",
67
+ "description": "difference of squares 1",
56
68
  "property": "differenceOfSquares",
57
- "number": 0,
69
+ "input": {
70
+ "number": 1
71
+ },
58
72
  "expected": 0
59
73
  },
60
74
  {
61
75
  "description": "difference of squares 5",
62
76
  "property": "differenceOfSquares",
63
- "number": 5,
77
+ "input": {
78
+ "number": 5
79
+ },
64
80
  "expected": 170
65
81
  },
66
- {
67
- "description": "difference of squares 10",
68
- "property": "differenceOfSquares",
69
- "number": 10,
70
- "expected": 2640
71
- },
72
82
  {
73
83
  "description": "difference of squares 100",
74
84
  "property": "differenceOfSquares",
75
- "number": 100,
85
+ "input": {
86
+ "number": 100
87
+ },
76
88
  "expected": 25164150
77
89
  }
78
90
  ]
79
91
  }
80
92
  ]
81
- }
93
+ }
@@ -1,23 +1,17 @@
1
1
  {
2
- "#": [
2
+ "#": [
3
3
  "Language implementations vary on the issue of missing input variables.",
4
4
  "In this set of test cases, the input variable is left out of the definition,",
5
5
  "and the generator would need to handle the language implementation."
6
- ],
7
- "cases": [
8
- {
9
- "description": "no name",
10
- "expected": "Hello, World!"
11
- },
12
- {
13
- "description": "sample name",
14
- "name": "Alice",
15
- "expected": "Hello, Alice!"
16
- },
17
- {
18
- "description": "other sample name",
19
- "name": "Bob",
20
- "expected": "Hello, Bob!"
21
- }
22
- ]
6
+ ],
7
+ "exercise": "hello-world",
8
+ "version": "1.1.0",
9
+ "cases": [
10
+ {
11
+ "description": "Say Hi!",
12
+ "property": "hello",
13
+ "input": {},
14
+ "expected": "Hello, World!"
15
+ }
16
+ ]
23
17
  }
@@ -1,39 +1,38 @@
1
1
  {
2
- "cases": [
3
- {
4
- "description": "leap year",
5
- "input": 1996,
6
- "expected": true
2
+ "exercise": "leap",
3
+ "version": "1.3.0",
4
+ "cases": [
5
+ {
6
+ "description": "year not divisible by 4: common year",
7
+ "property": "leapYear",
8
+ "input": {
9
+ "year": 2015
7
10
  },
8
- {
9
- "description": "standard and odd year",
10
- "input": 1997,
11
- "expected": false
11
+ "expected": false
12
+ },
13
+ {
14
+ "description": "year divisible by 4, not divisible by 100: leap year",
15
+ "property": "leapYear",
16
+ "input": {
17
+ "year": 1996
12
18
  },
13
- {
14
- "description": "standard even year",
15
- "input": 1998,
16
- "expected": false
19
+ "expected": true
20
+ },
21
+ {
22
+ "description": "year divisible by 100, not divisible by 400: common year",
23
+ "property": "leapYear",
24
+ "input": {
25
+ "year": 2100
17
26
  },
18
- {
19
- "description": "standard nineteenth century",
20
- "input": 1900,
21
- "expected": false
27
+ "expected": false
28
+ },
29
+ {
30
+ "description": "year divisible by 400: leap year",
31
+ "property": "leapYear",
32
+ "input": {
33
+ "year": 2000
22
34
  },
23
- {
24
- "description": "standard eighteenth century",
25
- "input": 1800,
26
- "expected": false
27
- },
28
- {
29
- "description": "leap twenty fourth century",
30
- "input": 2400,
31
- "expected": true
32
- },
33
- {
34
- "description": "leap y2k",
35
- "input": 2000,
36
- "expected": true
37
- }
38
- ]
39
- }
35
+ "expected": true
36
+ }
37
+ ]
38
+ }
@@ -3,7 +3,11 @@ open OUnit2
3
3
  open Parser
4
4
  open Model
5
5
 
6
- let ae exp got _test_ctxt = assert_equal exp got
6
+ let printer (r: (Model.tests, Parser.error) Result.t): string = match r with
7
+ | Ok tests -> tests_to_string tests
8
+ | Error e -> "error"
9
+
10
+ let ae (exp: (Model.tests, Parser.error) Result.t) (got: (Model.tests, Parser.error) Result.t) _test_ctxt = assert_equal exp got ~printer
7
11
 
8
12
  let single x = Ok (Single x)
9
13
 
@@ -24,35 +28,35 @@ let parser_tests = [
24
28
 
25
29
  "parses a single element with a description and expected string output" >::
26
30
  ae (single [{description = "d1"; parameters = [("expected", `String "value")]}])
27
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : \"value\"}]}");
31
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : \"value\"}]}");
28
32
 
29
33
  "parses a single element with a description and expected float output" >::
30
34
  ae (single [{description = "d1"; parameters = [("expected", `Float 100.)]}])
31
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : 100.0}]}");
35
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : 100.0}]}");
32
36
 
33
37
  "parses a single element with a description and expected bool output" >::
34
38
  ae (single [{description = "d1"; parameters = [("expected", `Bool true)];}])
35
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : true}]}");
39
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : true}]}");
36
40
 
37
41
  "parses a single element with a description and expected int list output" >::
38
42
  ae (single [{description = "d1"; parameters = [("expected", `List [`Int 1;`Int 2;`Int 3])]}])
39
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : [1, 2, 3]}]}");
43
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : [1, 2, 3]}]}");
40
44
 
41
45
  "parses a single element with a description and expected null output" >::
42
46
  ae (single [{description = "d1"; parameters = [("expected", `Null)]}])
43
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : null}]}");
47
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : null}]}");
44
48
 
45
49
  "parses a single element with an int key value pair" >::
46
- ae (single [{description = "d1"; parameters = [("input", `Int 1996); ("expected", `Bool true)]}])
47
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : 1996, \"expected\" : true}]}");
50
+ ae (single [{description = "d1"; parameters = [("expected", `Bool true); ("year", `Int 1996)]}])
51
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\": { \"year\" : 1996 }, \"expected\" : true}]}");
48
52
 
49
53
  "parses a single element with a string key value pair" >::
50
- ae (single [{description = "d1"; parameters = [("input", `String "some-string"); ("expected", `Int 85)]}])
51
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : \"some-string\", \"expected\" : 85}]}");
54
+ ae (single [{description = "d1"; parameters = [("expected", `Int 85); ("string", `String "some-string")]}])
55
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\": { \"string\" : \"some-string\" }, \"expected\" : 85}]}");
52
56
 
53
57
  "parses a single element with a string list key value pair" >::
54
- ae (single [{description = "d1"; parameters = [("input", `List [`String "s1"; `String "s2"]); ("expected", `Int 85)]}])
55
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : [\"s1\", \"s2\"], \"expected\" : 85}]}");
58
+ ae (single [{description = "d1"; parameters = [("expected", `Int 85); ("list", `List [`String "s1"; `String "s2"])]}])
59
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : { \"list\" : [\"s1\", \"s2\"] }, \"expected\" : 85}]}");
56
60
 
57
61
  "an element without a description is an Error" >::
58
62
  ae (Error NoDescription)
@@ -68,12 +72,12 @@ let parser_tests = [
68
72
 
69
73
  "parses a map in the expected parameter" >::(fun _ctx ->
70
74
  assert_equal (single [{description = "d1"; parameters = [("expected", `Assoc [("one", `Int 1); ("two", `Int 2)])]}])
71
- (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"expected\" : {\"one\": 1, \"two\": 2}}]}");
75
+ (call_parser "{\"cases\" : [{\"description\" : \"d1\", \"input\" : {}, \"expected\" : {\"one\": 1, \"two\": 2}}]}");
72
76
  );
73
77
 
74
78
  "parses leap.json" >::(fun ctxt ->
75
79
  match call_parser @@ In_channel.read_all "test/leap.json" with
76
- | Ok (Single p) -> assert_equal 7 (List.length p)
80
+ | Ok (Single p) -> assert_equal 4 (List.length p)
77
81
  | Ok (Suite p) -> assert_failure "was suite"
78
82
  | Error e -> assert_failure ("failed to parse leap.json: " ^ show_error e)
79
83
  );
@@ -15,7 +15,7 @@
15
15
  "cases": [
16
16
  {
17
17
  "description": "parses normal text as a paragraph",
18
- "input": "This will be a paragraph",
18
+ "input": { "input" : "This will be a paragraph" },
19
19
  "expected": "<p>This will be a paragraph</p>"
20
20
  }
21
21
  ]
@@ -1,4 +1,4 @@
1
1
  [package]
2
2
  name = "allergies"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
 
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "atbash-cipher"
3
- version = "1.0.0"
3
+ version = "1.1.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "binary-search"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
  authors = ["<marco.stahl@mailbox.org>"]
5
5
 
6
6
  [dependencies]
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "bob"
3
- version = "1.1.0"
3
+ version = "1.2.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "bracket-push"
3
- version = "1.1.0"
3
+ version = "1.2.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "collatz_conjecture"
3
- version = "1.1.1"
3
+ version = "1.2.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "difference-of-squares"
3
- version = "1.1.0"
3
+ version = "1.2.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "dominoes"
3
- version = "2.0.0"
3
+ version = "2.1.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "gigasecond"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
 
5
5
  [dependencies]
6
6
  chrono = "0.4"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "grains"
3
- version = "1.0.0"
3
+ version = "1.1.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "hello-world"
3
- version = "1.0.0"
3
+ version = "1.1.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "isogram"
3
- version = "1.2.0"
3
+ version = "1.3.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "largest-series-product"
3
- version = "1.0.0"
3
+ version = "1.1.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "minesweeper"
3
- version = "1.0.0"
3
+ version = "1.1.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "pascals-triangle"
3
- version = "1.2.0"
3
+ version = "1.3.0"
@@ -1,5 +1,5 @@
1
1
  [package]
2
2
  name = "perfect_numbers"
3
- version = "1.0.1"
3
+ version = "1.1.0"
4
4
 
5
5
  [dependencies]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "poker"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
  authors = ["Peter Goodspeed-Niklaus <peter.r.goodspeedniklaus@gmail.com>"]
5
5
 
6
6
  [dependencies]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "prime_factors"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
  authors = ["sacherjj <sacherjj@gmail.com>"]
5
5
 
6
6
  [dependencies]
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "queen-attack"
3
- version = "1.0.0"
3
+ version = "2.1.0"
@@ -1,3 +1,3 @@
1
1
  [package]
2
2
  name = "raindrops"
3
- version = "1.0.0"
3
+ version = "1.1.0"