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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/java/exercises/hamming/.meta/version +1 -1
- data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -1
- data/tracks/java/exercises/rotational-cipher/.meta/version +1 -1
- data/tracks/java/exercises/scrabble-score/.meta/version +1 -1
- data/tracks/java/exercises/secret-handshake/.meta/version +1 -1
- data/tracks/java/exercises/twelve-days/.meta/version +1 -1
- data/tracks/ocaml/tools/test-generator/src/model.ml +21 -0
- data/tracks/ocaml/tools/test-generator/src/ocaml_special_cases.ml +4 -5
- data/tracks/ocaml/tools/test-generator/src/parser.ml +16 -4
- data/tracks/ocaml/tools/test-generator/src/test_gen.ml +2 -2
- data/tracks/ocaml/tools/test-generator/src/utils.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/all-your-base/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/bob/test.ml +2 -2
- data/tracks/ocaml/tools/test-generator/templates/ocaml/bracket-push/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/dominoes/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/leap/test.ml +2 -2
- data/tracks/ocaml/tools/test-generator/templates/ocaml/luhn/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/minesweeper/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/palindrome-products/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/pangram/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/prime-factors/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/rectangles/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/run-length-encoding/test.ml +3 -3
- data/tracks/ocaml/tools/test-generator/templates/ocaml/say/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/templates/ocaml/word-count/test.ml +1 -1
- data/tracks/ocaml/tools/test-generator/test/beer-song.json +382 -31
- data/tracks/ocaml/tools/test-generator/test/clock.json +484 -333
- data/tracks/ocaml/tools/test-generator/test/difference_of_squares.json +38 -26
- data/tracks/ocaml/tools/test-generator/test/hello_world.json +12 -18
- data/tracks/ocaml/tools/test-generator/test/leap.json +33 -34
- data/tracks/ocaml/tools/test-generator/test/parser_test.ml +18 -14
- data/tracks/ocaml/tools/test-generator/test/with-methods-key.json +1 -1
- data/tracks/rust/exercises/allergies/Cargo.toml +1 -1
- data/tracks/rust/exercises/atbash-cipher/Cargo.toml +1 -1
- data/tracks/rust/exercises/binary-search/Cargo.toml +1 -1
- data/tracks/rust/exercises/bob/Cargo.toml +1 -1
- data/tracks/rust/exercises/bracket-push/Cargo.toml +1 -1
- data/tracks/rust/exercises/collatz-conjecture/Cargo.toml +1 -1
- data/tracks/rust/exercises/difference-of-squares/Cargo.toml +1 -1
- data/tracks/rust/exercises/dominoes/Cargo.toml +1 -1
- data/tracks/rust/exercises/gigasecond/Cargo.toml +1 -1
- data/tracks/rust/exercises/grains/Cargo.toml +1 -1
- data/tracks/rust/exercises/hello-world/Cargo.toml +1 -1
- data/tracks/rust/exercises/isogram/Cargo.toml +1 -1
- data/tracks/rust/exercises/largest-series-product/Cargo.toml +1 -1
- data/tracks/rust/exercises/minesweeper/Cargo.toml +1 -1
- data/tracks/rust/exercises/pascals-triangle/Cargo.toml +1 -1
- data/tracks/rust/exercises/perfect-numbers/Cargo.toml +1 -1
- data/tracks/rust/exercises/poker/Cargo.toml +1 -1
- data/tracks/rust/exercises/prime-factors/Cargo.toml +1 -1
- data/tracks/rust/exercises/queen-attack/Cargo.toml +1 -1
- data/tracks/rust/exercises/raindrops/Cargo.toml +1 -1
- data/tracks/rust/exercises/react/Cargo.toml +1 -1
- data/tracks/rust/exercises/rectangles/Cargo.toml +1 -1
- data/tracks/rust/exercises/robot-simulator/Cargo.toml +1 -1
- data/tracks/rust/exercises/run-length-encoding/Cargo.toml +1 -1
- data/tracks/rust/exercises/saddle-points/Cargo.toml +1 -1
- data/tracks/rust/exercises/say/Cargo.toml +1 -1
- data/tracks/rust/exercises/scrabble-score/Cargo.toml +1 -1
- data/tracks/rust/exercises/sieve/Cargo.toml +1 -1
- data/tracks/rust/exercises/space-age/Cargo.toml +1 -1
- data/tracks/rust/exercises/tournament/Cargo.toml +1 -1
- data/tracks/rust/exercises/variable-length-quantity/Cargo.toml +1 -1
- data/tracks/rust/exercises/wordy/Cargo.toml +1 -1
- metadata +2 -2
@@ -1,26 +1,32 @@
|
|
1
1
|
{
|
2
2
|
"exercise": "difference-of-squares",
|
3
|
-
"version": "1.
|
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
|
9
|
+
"description": "square of sum 1",
|
10
10
|
"property": "squareOfSum",
|
11
|
-
"
|
12
|
-
|
11
|
+
"input": {
|
12
|
+
"number": 1
|
13
|
+
},
|
14
|
+
"expected": 1
|
13
15
|
},
|
14
16
|
{
|
15
|
-
"description": "square of sum
|
17
|
+
"description": "square of sum 5",
|
16
18
|
"property": "squareOfSum",
|
17
|
-
"
|
18
|
-
|
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
|
-
"
|
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
|
38
|
+
"description": "sum of squares 1",
|
33
39
|
"property": "sumOfSquares",
|
34
|
-
"
|
35
|
-
|
40
|
+
"input": {
|
41
|
+
"number": 1
|
42
|
+
},
|
43
|
+
"expected": 1
|
36
44
|
},
|
37
45
|
{
|
38
|
-
"description": "sum of squares
|
46
|
+
"description": "sum of squares 5",
|
39
47
|
"property": "sumOfSquares",
|
40
|
-
"
|
41
|
-
|
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
|
-
"
|
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
|
67
|
+
"description": "difference of squares 1",
|
56
68
|
"property": "differenceOfSquares",
|
57
|
-
"
|
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
|
-
"
|
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
|
-
"
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
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
|
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 = [("
|
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 = [("
|
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 = [("
|
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
|
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
|
);
|