trackler 2.0.8.17 → 2.0.8.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/forth/canonical-data.json +307 -321
  3. data/common/exercises/largest-series-product/canonical-data.json +139 -122
  4. data/common/exercises/list-ops/canonical-data.json +162 -141
  5. data/common/exercises/markdown/canonical-data.json +15 -14
  6. data/common/exercises/pov/canonical-data.json +264 -116
  7. data/common/exercises/prime-factors/canonical-data.json +51 -40
  8. data/common/exercises/rail-fence-cipher/canonical-data.json +56 -44
  9. data/common/exercises/react/canonical-data.json +18 -4
  10. data/common/exercises/rectangles/canonical-data.json +16 -1
  11. data/common/exercises/rotational-cipher/canonical-data.json +81 -67
  12. data/common/exercises/run-length-encoding/canonical-data.json +89 -71
  13. data/common/exercises/space-age/canonical-data.json +61 -45
  14. data/common/exercises/sublist/canonical-data.json +136 -99
  15. data/common/exercises/transpose/canonical-data.json +207 -194
  16. data/common/exercises/variable-length-quantity/canonical-data.json +171 -141
  17. data/lib/trackler/version.rb +1 -1
  18. data/tracks/csharp/exercises/diamond/HINTS.md +9 -0
  19. data/tracks/go/README.md +3 -0
  20. data/tracks/go/exercises/queen-attack/queen_attack_test.go +1 -1
  21. data/tracks/haskell/exercises/hamming/src/Hamming.hs +2 -1
  22. data/tracks/java/exercises/flatten-array/src/test/java/FlattenerTest.java +5 -0
  23. data/tracks/ocaml/exercises/anagram/test.ml +2 -2
  24. data/tracks/ocaml/tools/test-generator/src/controller.ml +7 -2
  25. data/tracks/ocaml/tools/test-generator/src/parser.ml +31 -18
  26. data/tracks/ocaml/tools/test-generator/src/template.ml +10 -8
  27. data/tracks/ocaml/tools/test-generator/src/utils.ml +11 -0
  28. data/tracks/ocaml/tools/test-generator/templates/phone-number/template.ml +4 -5
  29. data/tracks/ocaml/tools/test-generator/test/beer-song.json +77 -0
  30. data/tracks/ocaml/tools/test-generator/test/difference_of_squares.json +76 -62
  31. data/tracks/ocaml/tools/test-generator/test/parser_test.ml +11 -9
  32. data/tracks/ocaml/tools/test-generator/test/template_test.ml +2 -2
  33. metadata +4 -2
@@ -1,50 +1,62 @@
1
1
  {
2
- "#": [
3
- "The tests do not expect any normalization or cleaning.",
4
- "That trade is tested in enough other exercises."
5
- ],
6
- "encode": {
2
+ "exercise": "rail-fence-cipher",
3
+ "version": "1.0.0",
4
+ "comments": [
5
+ "The tests do not expect any normalization or cleaning.",
6
+ "That trade is tested in enough other exercises."
7
+ ],
8
+ "cases": [
9
+ {
10
+ "description": "encode",
7
11
  "cases": [
8
- {
9
- "description": "test to encode with two rails",
10
- "msg": "XOXOXOXOXOXOXOXOXO",
11
- "rails": 2,
12
- "expected": "XXXXXXXXXOOOOOOOOO"
13
- },
14
- {
15
- "description": "test to encode with three rails",
16
- "msg": "WEAREDISCOVEREDFLEEATONCE",
17
- "rails": 3,
18
- "expected": "WECRLTEERDSOEEFEAOCAIVDEN"
19
- },
20
- {
21
- "description": "test to encode with ending in the middle",
22
- "msg": "EXERCISES",
23
- "rails": 4,
24
- "expected": "ESXIEECSR"
25
- }
12
+ {
13
+ "description": "test to encode with two rails",
14
+ "property": "encode",
15
+ "msg": "XOXOXOXOXOXOXOXOXO",
16
+ "rails": 2,
17
+ "expected": "XXXXXXXXXOOOOOOOOO"
18
+ },
19
+ {
20
+ "description": "test to encode with three rails",
21
+ "property": "encode",
22
+ "msg": "WEAREDISCOVEREDFLEEATONCE",
23
+ "rails": 3,
24
+ "expected": "WECRLTEERDSOEEFEAOCAIVDEN"
25
+ },
26
+ {
27
+ "description": "test to encode with ending in the middle",
28
+ "property": "encode",
29
+ "msg": "EXERCISES",
30
+ "rails": 4,
31
+ "expected": "ESXIEECSR"
32
+ }
26
33
  ]
27
- },
28
- "decode": {
34
+ },
35
+ {
36
+ "description": "decode",
29
37
  "cases": [
30
- {
31
- "description": "test to decode with three rails",
32
- "msg": "TEITELHDVLSNHDTISEIIEA",
33
- "rails": 3,
34
- "expected": "THEDEVILISINTHEDETAILS"
35
- },
36
- {
37
- "description": "test to decode with five rails",
38
- "msg": "EIEXMSMESAORIWSCE",
39
- "rails": 5,
40
- "expected": "EXERCISMISAWESOME"
41
- },
42
- {
43
- "description": "test to decode with six rails",
44
- "msg": "133714114238148966225439541018335470986172518171757571896261",
45
- "rails": 6,
46
- "expected": "112358132134558914423337761098715972584418167651094617711286"
47
- }
38
+ {
39
+ "description": "test to decode with three rails",
40
+ "property": "decode",
41
+ "msg": "TEITELHDVLSNHDTISEIIEA",
42
+ "rails": 3,
43
+ "expected": "THEDEVILISINTHEDETAILS"
44
+ },
45
+ {
46
+ "description": "test to decode with five rails",
47
+ "property": "decode",
48
+ "msg": "EIEXMSMESAORIWSCE",
49
+ "rails": 5,
50
+ "expected": "EXERCISMISAWESOME"
51
+ },
52
+ {
53
+ "description": "test to decode with six rails",
54
+ "property": "decode",
55
+ "msg": "133714114238148966225439541018335470986172518171757571896261",
56
+ "rails": 6,
57
+ "expected": "112358132134558914423337761098715972584418167651094617711286"
58
+ }
48
59
  ]
49
- }
60
+ }
61
+ ]
50
62
  }
@@ -1,5 +1,7 @@
1
1
  {
2
- "#": [
2
+ "exercise": "react",
3
+ "version": "1.0.0",
4
+ "comments": [
3
5
  "Note that, due to the nature of this exercise,",
4
6
  "the tests are specified using their cells and a series of operations to perform on the cells.",
5
7
  "",
@@ -43,6 +45,7 @@
43
45
  "cases": [
44
46
  {
45
47
  "description": "input cells have a value",
48
+ "property": "react",
46
49
  "cells": [
47
50
  {
48
51
  "name": "input",
@@ -60,6 +63,7 @@
60
63
  },
61
64
  {
62
65
  "description": "an input cell's value can be set",
66
+ "property": "react",
63
67
  "cells": [
64
68
  {
65
69
  "name": "input",
@@ -82,6 +86,7 @@
82
86
  },
83
87
  {
84
88
  "description": "compute cells calculate initial value",
89
+ "property": "react",
85
90
  "cells": [
86
91
  {
87
92
  "name": "input",
@@ -105,6 +110,7 @@
105
110
  },
106
111
  {
107
112
  "description": "compute cells take inputs in the right order",
113
+ "property": "react",
108
114
  "cells": [
109
115
  {
110
116
  "name": "one",
@@ -133,6 +139,7 @@
133
139
  },
134
140
  {
135
141
  "description": "compute cells update value when dependencies are changed",
142
+ "property": "react",
136
143
  "cells": [
137
144
  {
138
145
  "name": "input",
@@ -161,6 +168,7 @@
161
168
  },
162
169
  {
163
170
  "description": "compute cells can depend on other compute cells",
171
+ "property": "react",
164
172
  "cells": [
165
173
  {
166
174
  "name": "input",
@@ -206,6 +214,7 @@
206
214
  },
207
215
  {
208
216
  "description": "compute cells fire callbacks",
217
+ "property": "react",
209
218
  "cells": [
210
219
  {
211
220
  "name": "input",
@@ -239,6 +248,7 @@
239
248
  },
240
249
  {
241
250
  "description": "callback cells only fire on change",
251
+ "property": "react",
242
252
  "cells": [
243
253
  {
244
254
  "name": "input",
@@ -282,6 +292,7 @@
282
292
  },
283
293
  {
284
294
  "description": "callbacks can be added and removed",
295
+ "property": "react",
285
296
  "cells": [
286
297
  {
287
298
  "name": "input",
@@ -345,11 +356,12 @@
345
356
  },
346
357
  {
347
358
  "description": "removing a callback multiple times doesn't interfere with other callbacks",
348
- "#": [
359
+ "comments": [
349
360
  "Some incorrect implementations store their callbacks in an array",
350
361
  "and removing a callback repeatedly either removes an unrelated callback",
351
362
  "or causes an out of bounds access."
352
363
  ],
364
+ "property": "react",
353
365
  "cells": [
354
366
  {
355
367
  "name": "input",
@@ -408,10 +420,11 @@
408
420
  },
409
421
  {
410
422
  "description": "callbacks should only be called once even if multiple dependencies change",
411
- "#": [
423
+ "comments": [
412
424
  "Some incorrect implementations call a callback function too early,",
413
425
  "when not all of the inputs of a compute cell have propagated new values."
414
426
  ],
427
+ "property": "react",
415
428
  "cells": [
416
429
  {
417
430
  "name": "input",
@@ -463,11 +476,12 @@
463
476
  },
464
477
  {
465
478
  "description": "callbacks should not be called if dependencies change but output value doesn't change",
466
- "#": [
479
+ "comments": [
467
480
  "Some incorrect implementations simply mark a compute cell as dirty when a dependency changes,",
468
481
  "then call callbacks on all dirty cells.",
469
482
  "This is incorrect since the specification indicates only to call callbacks on change."
470
483
  ],
484
+ "property": "react",
471
485
  "cells": [
472
486
  {
473
487
  "name": "input",
@@ -1,26 +1,32 @@
1
1
  {
2
- "#": [
2
+ "exercise": "rectangles",
3
+ "version": "1.0.0",
4
+ "comments": [
3
5
  "The inputs are represented as arrays of strings to improve readability in this JSON file.",
4
6
  "Your track may choose whether to present the input as a single string (concatenating all the lines) or as the list."
5
7
  ],
6
8
  "cases": [
7
9
  {
8
10
  "description": "no rows",
11
+ "property": "rectangles",
9
12
  "input": [],
10
13
  "expected": 0
11
14
  },
12
15
  {
13
16
  "description": "no columns",
17
+ "property": "rectangles",
14
18
  "input": [""],
15
19
  "expected": 0
16
20
  },
17
21
  {
18
22
  "description": "no rectangles",
23
+ "property": "rectangles",
19
24
  "input": [" "],
20
25
  "expected": 0
21
26
  },
22
27
  {
23
28
  "description": "one rectangle",
29
+ "property": "rectangles",
24
30
  "input": [
25
31
  "+-+",
26
32
  "| |",
@@ -30,6 +36,7 @@
30
36
  },
31
37
  {
32
38
  "description": "two rectangles without shared parts",
39
+ "property": "rectangles",
33
40
  "input": [
34
41
  " +-+",
35
42
  " | |",
@@ -41,6 +48,7 @@
41
48
  },
42
49
  {
43
50
  "description": "five rectangles with shared parts",
51
+ "property": "rectangles",
44
52
  "input": [
45
53
  " +-+",
46
54
  " | |",
@@ -52,6 +60,7 @@
52
60
  },
53
61
  {
54
62
  "description": "rectangle of height 1 is counted",
63
+ "property": "rectangles",
55
64
  "input": [
56
65
  "+--+",
57
66
  "+--+"
@@ -60,6 +69,7 @@
60
69
  },
61
70
  {
62
71
  "description": "rectangle of width 1 is counted",
72
+ "property": "rectangles",
63
73
  "input": [
64
74
  "++",
65
75
  "||",
@@ -69,6 +79,7 @@
69
79
  },
70
80
  {
71
81
  "description": "1x1 square is counted",
82
+ "property": "rectangles",
72
83
  "input": [
73
84
  "++",
74
85
  "++"
@@ -77,6 +88,7 @@
77
88
  },
78
89
  {
79
90
  "description": "only complete rectangles are counted",
91
+ "property": "rectangles",
80
92
  "input": [
81
93
  " +-+",
82
94
  " |",
@@ -88,6 +100,7 @@
88
100
  },
89
101
  {
90
102
  "description": "rectangles can be of different sizes",
103
+ "property": "rectangles",
91
104
  "input": [
92
105
  "+------+----+",
93
106
  "| | |",
@@ -99,6 +112,7 @@
99
112
  },
100
113
  {
101
114
  "description": "corner is required for a rectangle to be complete",
115
+ "property": "rectangles",
102
116
  "input": [
103
117
  "+------+----+",
104
118
  "| | |",
@@ -110,6 +124,7 @@
110
124
  },
111
125
  {
112
126
  "description": "large input with many rectangles",
127
+ "property": "rectangles",
113
128
  "input": [
114
129
  "+---+--+----+",
115
130
  "| +--+----+",
@@ -1,70 +1,84 @@
1
1
  {
2
- "#": [
3
- "The tests are a series of rotation tests: "
4
- ],
5
- "rotate": {
6
- "description": ["Test rotation from English to ROTn"],
7
- "cases": [
8
- {
9
- "description": "rotate a by 1",
10
- "text": "a",
11
- "shift_key": 1,
12
- "expected": "b"
13
- },
14
- {
15
- "description": "rotate a by 26, same output as input",
16
- "text": "a",
17
- "shift_key": 26,
18
- "expected": "a"
19
- },
20
- {
21
- "description": "rotate a by 0, same output as input",
22
- "text": "a",
23
- "shift_key": 0,
24
- "expected": "a"
25
- },
26
- {
27
- "description": "rotate m by 13",
28
- "text": "m",
29
- "shift_key": 13,
30
- "expected": "z"
31
- },
32
- {
33
- "description": "rotate n by 13 with wrap around alphabet",
34
- "text": "n",
35
- "shift_key": 13,
36
- "expected": "a"
37
- },
38
- {
39
- "description": "rotate capital letters",
40
- "text": "OMG",
41
- "shift_key": 5,
42
- "expected": "TRL"
43
- },
44
- {
45
- "description": "rotate spaces",
46
- "text": "O M G",
47
- "shift_key": 5,
48
- "expected": "T R L"
49
- },
50
- {
51
- "description": "rotate numbers",
52
- "text": "Testing 1 2 3 testing",
53
- "shift_key": 4,
54
- "expected": "Xiwxmrk 1 2 3 xiwxmrk"
55
- },
56
- {
57
- "description": "rotate punctuation",
58
- "text": "Let's eat, Grandma!",
59
- "shift_key": 21,
60
- "expected": "Gzo'n zvo, Bmviyhv!"
61
- },
62
- {
63
- "description": "rotate all letters",
64
- "text": "The quick brown fox jumps over the lazy dog.",
65
- "shift_key": 13,
66
- "expected": "Gur dhvpx oebja sbk whzcf bire gur ynml qbt."
67
- }
68
- ]
2
+ "exercise": "rotational-cipher",
3
+ "version": "1.0.0",
4
+ "comments": [
5
+ "The tests are a series of rotation tests: "
6
+ ],
7
+ "cases": [
8
+ {
9
+ "description": "Test rotation from English to ROTn",
10
+ "cases": [
11
+ {
12
+ "description": "rotate a by 1",
13
+ "property": "rotate",
14
+ "text": "a",
15
+ "shiftKey": 1,
16
+ "expected": "b"
17
+ },
18
+ {
19
+ "description": "rotate a by 26, same output as input",
20
+ "property": "rotate",
21
+ "text": "a",
22
+ "shiftKey": 26,
23
+ "expected": "a"
24
+ },
25
+ {
26
+ "description": "rotate a by 0, same output as input",
27
+ "property": "rotate",
28
+ "text": "a",
29
+ "shiftKey": 0,
30
+ "expected": "a"
31
+ },
32
+ {
33
+ "description": "rotate m by 13",
34
+ "property": "rotate",
35
+ "text": "m",
36
+ "shiftKey": 13,
37
+ "expected": "z"
38
+ },
39
+ {
40
+ "description": "rotate n by 13 with wrap around alphabet",
41
+ "property": "rotate",
42
+ "text": "n",
43
+ "shiftKey": 13,
44
+ "expected": "a"
45
+ },
46
+ {
47
+ "description": "rotate capital letters",
48
+ "property": "rotate",
49
+ "text": "OMG",
50
+ "shiftKey": 5,
51
+ "expected": "TRL"
52
+ },
53
+ {
54
+ "description": "rotate spaces",
55
+ "property": "rotate",
56
+ "text": "O M G",
57
+ "shiftKey": 5,
58
+ "expected": "T R L"
59
+ },
60
+ {
61
+ "description": "rotate numbers",
62
+ "property": "rotate",
63
+ "text": "Testing 1 2 3 testing",
64
+ "shiftKey": 4,
65
+ "expected": "Xiwxmrk 1 2 3 xiwxmrk"
66
+ },
67
+ {
68
+ "description": "rotate punctuation",
69
+ "property": "rotate",
70
+ "text": "Let's eat, Grandma!",
71
+ "shiftKey": 21,
72
+ "expected": "Gzo'n zvo, Bmviyhv!"
73
+ },
74
+ {
75
+ "description": "rotate all letters",
76
+ "property": "rotate",
77
+ "text": "The quick brown fox jumps over the lazy dog.",
78
+ "shiftKey": 13,
79
+ "expected": "Gur dhvpx oebja sbk whzcf bire gur ynml qbt."
80
+ }
81
+ ]
69
82
  }
83
+ ]
70
84
  }
@@ -1,81 +1,99 @@
1
1
  {
2
- "encode": {
2
+ "exercise": "run-length-encoding",
3
+ "version": "1.0.0",
4
+ "cases": [
5
+ {
3
6
  "description": "run-length encode a string",
4
7
  "cases": [
5
- {
6
- "description": "empty string",
7
- "input": "",
8
- "expected": ""
9
- },
10
- {
11
- "description": "single characters only are encoded without count",
12
- "input": "XYZ",
13
- "expected": "XYZ"
14
- },
15
- {
16
- "description": "string with no single characters",
17
- "input": "AABBBCCCC",
18
- "expected": "2A3B4C"
19
- },
20
- {
21
- "description": "single characters mixed with repeated characters",
22
- "input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB",
23
- "expected": "12WB12W3B24WB"
24
- },
25
- {
26
- "description": "multiple whitespace mixed in string",
27
- "input": " hsqq qww ",
28
- "expected": "2 hs2q q2w2 "
29
- },
30
- {
31
- "description": "lowercase characters",
32
- "input": "aabbbcccc",
33
- "expected": "2a3b4c"
34
- }
8
+ {
9
+ "description": "empty string",
10
+ "property": "encode",
11
+ "input": "",
12
+ "expected": ""
13
+ },
14
+ {
15
+ "description": "single characters only are encoded without count",
16
+ "property": "encode",
17
+ "input": "XYZ",
18
+ "expected": "XYZ"
19
+ },
20
+ {
21
+ "description": "string with no single characters",
22
+ "property": "encode",
23
+ "input": "AABBBCCCC",
24
+ "expected": "2A3B4C"
25
+ },
26
+ {
27
+ "description": "single characters mixed with repeated characters",
28
+ "property": "encode",
29
+ "input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB",
30
+ "expected": "12WB12W3B24WB"
31
+ },
32
+ {
33
+ "description": "multiple whitespace mixed in string",
34
+ "property": "encode",
35
+ "input": " hsqq qww ",
36
+ "expected": "2 hs2q q2w2 "
37
+ },
38
+ {
39
+ "description": "lowercase characters",
40
+ "property": "encode",
41
+ "input": "aabbbcccc",
42
+ "expected": "2a3b4c"
43
+ }
35
44
  ]
36
- },
37
- "decode": {
45
+ },
46
+ {
38
47
  "description": "run-length decode a string",
39
48
  "cases": [
40
- {
41
- "description": "empty string",
42
- "input": "",
43
- "expected": ""
44
- },
45
- {
46
- "description": "single characters only",
47
- "input": "XYZ",
48
- "expected": "XYZ"
49
- },
50
- {
51
- "description": "string with no single characters",
52
- "input": "2A3B4C",
53
- "expected": "AABBBCCCC"
54
- },
55
- {
56
- "description": "single characters with repeated characters",
57
- "input": "12WB12W3B24WB",
58
- "expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
59
- },
60
- {
61
- "description": "multiple whitespace mixed in string",
62
- "input": "2 hs2q q2w2 ",
63
- "expected": " hsqq qww "
64
- },
65
- {
66
- "description": "lower case string",
67
- "input": "2a3b4c",
68
- "expected": "aabbbcccc"
69
- }
49
+ {
50
+ "description": "empty string",
51
+ "property": "decode",
52
+ "input": "",
53
+ "expected": ""
54
+ },
55
+ {
56
+ "description": "single characters only",
57
+ "property": "decode",
58
+ "input": "XYZ",
59
+ "expected": "XYZ"
60
+ },
61
+ {
62
+ "description": "string with no single characters",
63
+ "property": "decode",
64
+ "input": "2A3B4C",
65
+ "expected": "AABBBCCCC"
66
+ },
67
+ {
68
+ "description": "single characters with repeated characters",
69
+ "property": "decode",
70
+ "input": "12WB12W3B24WB",
71
+ "expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
72
+ },
73
+ {
74
+ "description": "multiple whitespace mixed in string",
75
+ "property": "decode",
76
+ "input": "2 hs2q q2w2 ",
77
+ "expected": " hsqq qww "
78
+ },
79
+ {
80
+ "description": "lower case string",
81
+ "property": "decode",
82
+ "input": "2a3b4c",
83
+ "expected": "aabbbcccc"
84
+ }
70
85
  ]
71
- },
72
- "consistency": {
86
+ },
87
+ {
88
+ "description": "encode and then decode",
73
89
  "cases": [
74
- {
75
- "description": "encode followed by decode gives original string",
76
- "input": "zzz ZZ zZ",
77
- "expected": "zzz ZZ zZ"
78
- }
90
+ {
91
+ "description": "encode followed by decode gives original string",
92
+ "property": "consistency",
93
+ "input": "zzz ZZ zZ",
94
+ "expected": "zzz ZZ zZ"
95
+ }
79
96
  ]
80
- }
97
+ }
98
+ ]
81
99
  }