trackler 2.0.8.17 → 2.0.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/common/exercises/forth/canonical-data.json +307 -321
- data/common/exercises/largest-series-product/canonical-data.json +139 -122
- data/common/exercises/list-ops/canonical-data.json +162 -141
- data/common/exercises/markdown/canonical-data.json +15 -14
- data/common/exercises/pov/canonical-data.json +264 -116
- data/common/exercises/prime-factors/canonical-data.json +51 -40
- data/common/exercises/rail-fence-cipher/canonical-data.json +56 -44
- data/common/exercises/react/canonical-data.json +18 -4
- data/common/exercises/rectangles/canonical-data.json +16 -1
- data/common/exercises/rotational-cipher/canonical-data.json +81 -67
- data/common/exercises/run-length-encoding/canonical-data.json +89 -71
- data/common/exercises/space-age/canonical-data.json +61 -45
- data/common/exercises/sublist/canonical-data.json +136 -99
- data/common/exercises/transpose/canonical-data.json +207 -194
- data/common/exercises/variable-length-quantity/canonical-data.json +171 -141
- data/lib/trackler/version.rb +1 -1
- data/tracks/csharp/exercises/diamond/HINTS.md +9 -0
- data/tracks/go/README.md +3 -0
- data/tracks/go/exercises/queen-attack/queen_attack_test.go +1 -1
- data/tracks/haskell/exercises/hamming/src/Hamming.hs +2 -1
- data/tracks/java/exercises/flatten-array/src/test/java/FlattenerTest.java +5 -0
- data/tracks/ocaml/exercises/anagram/test.ml +2 -2
- data/tracks/ocaml/tools/test-generator/src/controller.ml +7 -2
- data/tracks/ocaml/tools/test-generator/src/parser.ml +31 -18
- data/tracks/ocaml/tools/test-generator/src/template.ml +10 -8
- data/tracks/ocaml/tools/test-generator/src/utils.ml +11 -0
- data/tracks/ocaml/tools/test-generator/templates/phone-number/template.ml +4 -5
- data/tracks/ocaml/tools/test-generator/test/beer-song.json +77 -0
- data/tracks/ocaml/tools/test-generator/test/difference_of_squares.json +76 -62
- data/tracks/ocaml/tools/test-generator/test/parser_test.ml +11 -9
- data/tracks/ocaml/tools/test-generator/test/template_test.ml +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc58526fa26ab3ee7b880060f19b9ff38f74b50
|
4
|
+
data.tar.gz: 500d43b55f63f5549d3c0f88de2e5e8eef4a4bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d94503aabd35ef75be0b356984f834a0e8ee6b537dbe2f2e4002e5f9fa6ea0ea78224ab5edfa1ea30a58e563ad458480b3732172aa9955b99ca81c9c2f2367ed
|
7
|
+
data.tar.gz: 19bac46a8dfb31ec316cd4db44641fb476224a018537e7f0de83b83ee423c5826c623fa6d44be744a2dd87a264b6b84f94f21ed8edcda8c019be3e7e6b51fd2d
|
@@ -1,327 +1,313 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"exercise": "forth",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"comments": [
|
3
5
|
"The cases are split into multiple sections, all with the same structure.",
|
4
6
|
"In all cases, the `expected` key is the resulting stack",
|
5
7
|
"after executing the Forth program contained in the `input` key."
|
6
8
|
],
|
7
|
-
"
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
"1 +"
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
"3 4 -"
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
"
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
"
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
"
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
"
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
"
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
"
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
"
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
"
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
"
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
"
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
"
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
"
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
":
|
290
|
-
"
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
":
|
298
|
-
":
|
299
|
-
"1
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
":
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
{
|
312
|
-
"description": "cannot redefine numbers",
|
313
|
-
"input": [
|
314
|
-
": 1 2 ;"
|
315
|
-
],
|
316
|
-
"expected": null
|
317
|
-
},
|
318
|
-
{
|
319
|
-
"description": "errors if executing a non-existent word",
|
320
|
-
"input": [
|
321
|
-
"foo"
|
322
|
-
],
|
323
|
-
"expected": null
|
324
|
-
}
|
325
|
-
]
|
326
|
-
}
|
9
|
+
"cases": [
|
10
|
+
{
|
11
|
+
"description": "parsing and numbers",
|
12
|
+
"cases": [
|
13
|
+
{
|
14
|
+
"description": "empty input results in empty stack",
|
15
|
+
"property": "evaluate",
|
16
|
+
"input": [],
|
17
|
+
"expected": []
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"description": "numbers just get pushed onto the stack",
|
21
|
+
"property": "evaluate",
|
22
|
+
"input": ["1 2 3 4 5"],
|
23
|
+
"expected": [1, 2, 3, 4, 5]
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"description": "all non-word characters are separators",
|
27
|
+
"property": "evaluate",
|
28
|
+
"input": ["1\u00002\u00133\n4\r5 6\t7"],
|
29
|
+
"expected": [1, 2, 3, 4, 5, 6, 7]
|
30
|
+
}
|
31
|
+
]
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"description": "addition",
|
35
|
+
"cases": [
|
36
|
+
{
|
37
|
+
"description": "can add two numbers",
|
38
|
+
"property": "evaluate",
|
39
|
+
"input": ["1 2 +"],
|
40
|
+
"expected": [3]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"description": "errors if there is nothing on the stack",
|
44
|
+
"property": "evaluate",
|
45
|
+
"input": ["+"],
|
46
|
+
"expected": null
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"description": "errors if there is only one value on the stack",
|
50
|
+
"property": "evaluate",
|
51
|
+
"input": ["1 +"],
|
52
|
+
"expected": null
|
53
|
+
}
|
54
|
+
]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"description": "subtraction",
|
58
|
+
"cases": [
|
59
|
+
{
|
60
|
+
"description": "can subtract two numbers",
|
61
|
+
"property": "evaluate",
|
62
|
+
"input": ["3 4 -"],
|
63
|
+
"expected": [-1]
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"description": "errors if there is nothing on the stack",
|
67
|
+
"property": "evaluate",
|
68
|
+
"input": ["-"],
|
69
|
+
"expected": null
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"description": "errors if there is only one value on the stack",
|
73
|
+
"property": "evaluate",
|
74
|
+
"input": ["1 -"],
|
75
|
+
"expected": null
|
76
|
+
}
|
77
|
+
]
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"description": "multiplication",
|
81
|
+
"cases": [
|
82
|
+
{
|
83
|
+
"description": "can multiply two numbers",
|
84
|
+
"property": "evaluate",
|
85
|
+
"input": ["2 4 *"],
|
86
|
+
"expected": [8]
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"description": "errors if there is nothing on the stack",
|
90
|
+
"property": "evaluate",
|
91
|
+
"input": ["*"],
|
92
|
+
"expected": null
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"description": "errors if there is only one value on the stack",
|
96
|
+
"property": "evaluate",
|
97
|
+
"input": ["1 *"],
|
98
|
+
"expected": null
|
99
|
+
}
|
100
|
+
]
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"description": "division",
|
104
|
+
"cases": [
|
105
|
+
{
|
106
|
+
"description": "can divide two numbers",
|
107
|
+
"property": "evaluate",
|
108
|
+
"input": ["12 3 /"],
|
109
|
+
"expected": [4]
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"description": "performs integer division",
|
113
|
+
"property": "evaluate",
|
114
|
+
"input": ["8 3 /"],
|
115
|
+
"expected": [2]
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"description": "errors if dividing by zero",
|
119
|
+
"property": "evaluate",
|
120
|
+
"input": ["4 0 /"],
|
121
|
+
"expected": null
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"description": "errors if there is nothing on the stack",
|
125
|
+
"property": "evaluate",
|
126
|
+
"input": ["/"],
|
127
|
+
"expected": null
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"description": "errors if there is only one value on the stack",
|
131
|
+
"property": "evaluate",
|
132
|
+
"input": ["1 /"],
|
133
|
+
"expected": null
|
134
|
+
}
|
135
|
+
]
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"description": "combined arithmetic",
|
139
|
+
"cases": [
|
140
|
+
{
|
141
|
+
"description": "addition and subtraction",
|
142
|
+
"property": "evaluate",
|
143
|
+
"input": ["1 2 + 4 -"],
|
144
|
+
"expected": [-1]
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"description": "multiplication and division",
|
148
|
+
"property": "evaluate",
|
149
|
+
"input": ["2 4 * 3 /"],
|
150
|
+
"expected": [2]
|
151
|
+
}
|
152
|
+
]
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"description": "dup",
|
156
|
+
"cases": [
|
157
|
+
{
|
158
|
+
"description": "copies the top value on the stack",
|
159
|
+
"property": "evaluate",
|
160
|
+
"input": ["1 DUP"],
|
161
|
+
"expected": [1, 1]
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"description": "is case-insensitive",
|
165
|
+
"property": "evaluate",
|
166
|
+
"input": ["1 2 Dup"],
|
167
|
+
"expected": [1, 2, 2]
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"description": "errors if there is nothing on the stack",
|
171
|
+
"property": "evaluate",
|
172
|
+
"input": ["dup"],
|
173
|
+
"expected": null
|
174
|
+
}
|
175
|
+
]
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"description": "drop",
|
179
|
+
"cases": [
|
180
|
+
{
|
181
|
+
"description": "removes the top value on the stack if it is the only one",
|
182
|
+
"property": "evaluate",
|
183
|
+
"input": ["1 drop"],
|
184
|
+
"expected": []
|
185
|
+
},
|
186
|
+
{
|
187
|
+
"description": "removes the top value on the stack if it is not the only one",
|
188
|
+
"property": "evaluate",
|
189
|
+
"input": ["1 2 drop"],
|
190
|
+
"expected": [1]
|
191
|
+
},
|
192
|
+
{
|
193
|
+
"description": "errors if there is nothing on the stack",
|
194
|
+
"property": "evaluate",
|
195
|
+
"input": ["drop"],
|
196
|
+
"expected": null
|
197
|
+
}
|
198
|
+
]
|
199
|
+
},
|
200
|
+
{
|
201
|
+
"description": "swap",
|
202
|
+
"cases": [
|
203
|
+
{
|
204
|
+
"description": "swaps the top two values on the stack if they are the only ones",
|
205
|
+
"property": "evaluate",
|
206
|
+
"input": ["1 2 swap"],
|
207
|
+
"expected": [2, 1]
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"description": "swaps the top two values on the stack if they are not the only ones",
|
211
|
+
"property": "evaluate",
|
212
|
+
"input": ["1 2 3 swap"],
|
213
|
+
"expected": [1, 3, 2]
|
214
|
+
},
|
215
|
+
{
|
216
|
+
"description": "errors if there is nothing on the stack",
|
217
|
+
"property": "evaluate",
|
218
|
+
"input": ["swap"],
|
219
|
+
"expected": null
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"description": "errors if there is only one value on the stack",
|
223
|
+
"property": "evaluate",
|
224
|
+
"input": ["1 swap"],
|
225
|
+
"expected": null
|
226
|
+
}
|
227
|
+
]
|
228
|
+
},
|
229
|
+
{
|
230
|
+
"description": "over",
|
231
|
+
"cases": [
|
232
|
+
{
|
233
|
+
"description": "copies the second element if there are only two",
|
234
|
+
"property": "evaluate",
|
235
|
+
"input": ["1 2 over"],
|
236
|
+
"expected": [1, 2, 1]
|
237
|
+
},
|
238
|
+
{
|
239
|
+
"description": "copies the second element if there are more than two",
|
240
|
+
"property": "evaluate",
|
241
|
+
"input": ["1 2 3 over"],
|
242
|
+
"expected": [1, 2, 3, 2]
|
243
|
+
},
|
244
|
+
{
|
245
|
+
"description": "errors if there is nothing on the stack",
|
246
|
+
"property": "evaluate",
|
247
|
+
"input": ["over"],
|
248
|
+
"expected": null
|
249
|
+
},
|
250
|
+
{
|
251
|
+
"description": "errors if there is only one value on the stack",
|
252
|
+
"property": "evaluate",
|
253
|
+
"input": ["1 over"],
|
254
|
+
"expected": null
|
255
|
+
}
|
256
|
+
]
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"description": "user-defined words",
|
260
|
+
"cases": [
|
261
|
+
{
|
262
|
+
"description": "can consist of built-in words",
|
263
|
+
"property": "evaluate",
|
264
|
+
"input": [
|
265
|
+
": dup-twice dup dup ;",
|
266
|
+
"1 dup-twice"
|
267
|
+
],
|
268
|
+
"expected": [1, 1, 1]
|
269
|
+
},
|
270
|
+
{
|
271
|
+
"description": "execute in the right order",
|
272
|
+
"property": "evaluate",
|
273
|
+
"input": [
|
274
|
+
": countup 1 2 3 ;",
|
275
|
+
"countup"
|
276
|
+
],
|
277
|
+
"expected": [1, 2, 3]
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"description": "can override other user-defined words",
|
281
|
+
"property": "evaluate",
|
282
|
+
"input": [
|
283
|
+
": foo dup ;",
|
284
|
+
": foo dup dup ;",
|
285
|
+
"1 foo"
|
286
|
+
],
|
287
|
+
"expected": [1, 1, 1]
|
288
|
+
},
|
289
|
+
{
|
290
|
+
"description": "can override built-in words",
|
291
|
+
"property": "evaluate",
|
292
|
+
"input": [
|
293
|
+
": swap dup ;",
|
294
|
+
"1 swap"
|
295
|
+
],
|
296
|
+
"expected": [1, 1]
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"description": "cannot redefine numbers",
|
300
|
+
"property": "evaluate",
|
301
|
+
"input": [": 1 2 ;"],
|
302
|
+
"expected": null
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"description": "errors if executing a non-existent word",
|
306
|
+
"property": "evaluate",
|
307
|
+
"input": ["foo"],
|
308
|
+
"expected": null
|
309
|
+
}
|
310
|
+
]
|
311
|
+
}
|
312
|
+
]
|
327
313
|
}
|