trackler 1.0.2.0 → 1.0.2.1
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/acronym/canonical-data.json +5 -0
- data/common/exercises/forth/canonical-data.json +334 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/ruby/exercises/gigasecond/example.tt +0 -1
- data/tracks/ruby/exercises/gigasecond/gigasecond_test.rb +0 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e06b542955e59889186403c35a238dd6af7d74
|
4
|
+
data.tar.gz: e006a217238c4c593dbcdfb496c788726a111674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a408201116350c22709b07a864d47fa171b99d89207852a0e2375a9e829a46b15eefa5159091659191104a440f6a45643bc40e960ba6a00498389734c417fa28
|
7
|
+
data.tar.gz: 116a47b0684ce678756f049516bedd98bc38bfe1a28633262cbfbb1512980c1135120169ad8e06b1f6e40f7b937661fc09f18a3132ddeafdbe2639b63112c012
|
@@ -27,6 +27,11 @@
|
|
27
27
|
"phrase": "PHP: Hypertext Preprocessor",
|
28
28
|
"expected": "PHP"
|
29
29
|
},
|
30
|
+
{
|
31
|
+
"description": "non-acronym all caps word",
|
32
|
+
"phrase": "GNU Image Manipulation Program",
|
33
|
+
"expected": "GIMP"
|
34
|
+
},
|
30
35
|
{
|
31
36
|
"description": "hyphenated",
|
32
37
|
"phrase": "Complementary metal-oxide semiconductor",
|
@@ -0,0 +1,334 @@
|
|
1
|
+
{
|
2
|
+
"#": [
|
3
|
+
"The cases are split into multiple sections, all with the same structure.",
|
4
|
+
"In all cases, the `expected` key is the resulting stack",
|
5
|
+
"after executing the Forth program contained in the `input` key."
|
6
|
+
],
|
7
|
+
"parsing and numbers": {
|
8
|
+
"cases": [
|
9
|
+
{
|
10
|
+
"description": "empty input results in empty stack",
|
11
|
+
"input": [],
|
12
|
+
"expected": []
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"description": "numbers just get pushed onto the stack",
|
16
|
+
"input": [
|
17
|
+
"1 2 3 4 5"
|
18
|
+
],
|
19
|
+
"expected": [1, 2, 3, 4, 5]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"description": "all non-word characters are separators",
|
23
|
+
"input": [
|
24
|
+
"1\u00002\u00133\n4\r5 6\t7"
|
25
|
+
],
|
26
|
+
"expected": [1, 2, 3, 4, 5, 6, 7]
|
27
|
+
}
|
28
|
+
]
|
29
|
+
},
|
30
|
+
"addition": {
|
31
|
+
"cases": [
|
32
|
+
{
|
33
|
+
"description": "can add two numbers",
|
34
|
+
"input": [
|
35
|
+
"1 2 +"
|
36
|
+
],
|
37
|
+
"expected": [3]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"description": "errors if there is nothing on the stack",
|
41
|
+
"input": [
|
42
|
+
"+"
|
43
|
+
],
|
44
|
+
"expected": null
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"description": "errors if there is only one value on the stack",
|
48
|
+
"input": [
|
49
|
+
"1 +"
|
50
|
+
],
|
51
|
+
"expected": null
|
52
|
+
}
|
53
|
+
]
|
54
|
+
},
|
55
|
+
"subtraction": {
|
56
|
+
"cases": [
|
57
|
+
{
|
58
|
+
"description": "can subtract two numbers",
|
59
|
+
"input": [
|
60
|
+
"3 4 -"
|
61
|
+
],
|
62
|
+
"expected": [-1]
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"description": "errors if there is nothing on the stack",
|
66
|
+
"input": [
|
67
|
+
"-"
|
68
|
+
],
|
69
|
+
"expected": null
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"description": "errors if there is only one value on the stack",
|
73
|
+
"input": [
|
74
|
+
"1 -"
|
75
|
+
],
|
76
|
+
"expected": null
|
77
|
+
}
|
78
|
+
]
|
79
|
+
},
|
80
|
+
"multiplication": {
|
81
|
+
"cases": [
|
82
|
+
{
|
83
|
+
"description": "can multiply two numbers",
|
84
|
+
"input": [
|
85
|
+
"2 4 *"
|
86
|
+
],
|
87
|
+
"expected": [8]
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"description": "errors if there is nothing on the stack",
|
91
|
+
"input": [
|
92
|
+
"*"
|
93
|
+
],
|
94
|
+
"expected": null
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"description": "errors if there is only one value on the stack",
|
98
|
+
"input": [
|
99
|
+
"1 *"
|
100
|
+
],
|
101
|
+
"expected": null
|
102
|
+
}
|
103
|
+
]
|
104
|
+
},
|
105
|
+
"division": {
|
106
|
+
"cases": [
|
107
|
+
{
|
108
|
+
"description": "can divide two numbers",
|
109
|
+
"input": [
|
110
|
+
"12 3 /"
|
111
|
+
],
|
112
|
+
"expected": [4]
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"description": "performs integer division",
|
116
|
+
"input": [
|
117
|
+
"8 3 /"
|
118
|
+
],
|
119
|
+
"expected": [2]
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"description": "errors if dividing by zero",
|
123
|
+
"input": [
|
124
|
+
"4 0 /"
|
125
|
+
],
|
126
|
+
"expected": null
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"description": "errors if there is nothing on the stack",
|
130
|
+
"input": [
|
131
|
+
"/"
|
132
|
+
],
|
133
|
+
"expected": null
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"description": "errors if there is only one value on the stack",
|
137
|
+
"input": [
|
138
|
+
"1 /"
|
139
|
+
],
|
140
|
+
"expected": null
|
141
|
+
}
|
142
|
+
]
|
143
|
+
},
|
144
|
+
"combined arithmetic": {
|
145
|
+
"cases": [
|
146
|
+
{
|
147
|
+
"description": "addition and subtraction",
|
148
|
+
"input": [
|
149
|
+
"1 2 + 4 -"
|
150
|
+
],
|
151
|
+
"expected": [-1]
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"description": "multiplication and division",
|
155
|
+
"input": [
|
156
|
+
"2 4 * 3 /"
|
157
|
+
],
|
158
|
+
"expected": [2]
|
159
|
+
}
|
160
|
+
]
|
161
|
+
},
|
162
|
+
"dup": {
|
163
|
+
"cases": [
|
164
|
+
{
|
165
|
+
"description": "copies the top value on the stack",
|
166
|
+
"input": [
|
167
|
+
"1 DUP"
|
168
|
+
],
|
169
|
+
"expected": [1, 1]
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"description": "is case-insensitive",
|
173
|
+
"input": [
|
174
|
+
"1 2 Dup"
|
175
|
+
],
|
176
|
+
"expected": [1, 2, 2]
|
177
|
+
},
|
178
|
+
{
|
179
|
+
"description": "errors if there is nothing on the stack",
|
180
|
+
"input": [
|
181
|
+
"dup"
|
182
|
+
],
|
183
|
+
"expected": null
|
184
|
+
}
|
185
|
+
]
|
186
|
+
},
|
187
|
+
"drop": {
|
188
|
+
"cases": [
|
189
|
+
{
|
190
|
+
"description": "removes the top value on the stack if it is the only one",
|
191
|
+
"input": [
|
192
|
+
"1 drop"
|
193
|
+
],
|
194
|
+
"expected": []
|
195
|
+
},
|
196
|
+
{
|
197
|
+
"description": "removes the top value on the stack if it not is the only one",
|
198
|
+
"input": [
|
199
|
+
"1 2 drop"
|
200
|
+
],
|
201
|
+
"expected": [1]
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"description": "errors if there is nothing on the stack",
|
205
|
+
"input": [
|
206
|
+
"drop"
|
207
|
+
],
|
208
|
+
"expected": null
|
209
|
+
}
|
210
|
+
]
|
211
|
+
},
|
212
|
+
"swap": {
|
213
|
+
"cases": [
|
214
|
+
{
|
215
|
+
"description": "swaps the top two values on the stack if they are the only ones",
|
216
|
+
"input": [
|
217
|
+
"1 2 swap"
|
218
|
+
],
|
219
|
+
"expected": [2, 1]
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"description": "swaps the top two values on the stack if they are not the only ones",
|
223
|
+
"input": [
|
224
|
+
"1 2 3 swap"
|
225
|
+
],
|
226
|
+
"expected": [1, 3, 2]
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"description": "errors if there is nothing on the stack",
|
230
|
+
"input": [
|
231
|
+
"swap"
|
232
|
+
],
|
233
|
+
"expected": null
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"description": "errors if there is only one value on the stack",
|
237
|
+
"input": [
|
238
|
+
"1 swap"
|
239
|
+
],
|
240
|
+
"expected": null
|
241
|
+
}
|
242
|
+
]
|
243
|
+
},
|
244
|
+
"over": {
|
245
|
+
"cases": [
|
246
|
+
{
|
247
|
+
"description": "copies the second element if there are only two",
|
248
|
+
"input": [
|
249
|
+
"1 2 over"
|
250
|
+
],
|
251
|
+
"expected": [1, 2, 1]
|
252
|
+
},
|
253
|
+
{
|
254
|
+
"description": "copies the second element if there are more than two",
|
255
|
+
"input": [
|
256
|
+
"1 2 3 over"
|
257
|
+
],
|
258
|
+
"expected": [1, 2, 3, 2]
|
259
|
+
},
|
260
|
+
{
|
261
|
+
"description": "errors if there is nothing on the stack",
|
262
|
+
"input": [
|
263
|
+
"over"
|
264
|
+
],
|
265
|
+
"expected": null
|
266
|
+
},
|
267
|
+
{
|
268
|
+
"description": "errors if there is only one value on the stack",
|
269
|
+
"input": [
|
270
|
+
"1 over"
|
271
|
+
],
|
272
|
+
"expected": null
|
273
|
+
}
|
274
|
+
]
|
275
|
+
},
|
276
|
+
"user-defined words": {
|
277
|
+
"cases": [
|
278
|
+
{
|
279
|
+
"description": "can consist of built-in words",
|
280
|
+
"input": [
|
281
|
+
": dup-twice dup dup ;",
|
282
|
+
"1 dup-twice"
|
283
|
+
],
|
284
|
+
"expected": [1, 1, 1]
|
285
|
+
},
|
286
|
+
{
|
287
|
+
"description": "execute in the right order",
|
288
|
+
"input": [
|
289
|
+
": countup 1 2 3 ;",
|
290
|
+
"countup"
|
291
|
+
],
|
292
|
+
"expected": [1, 2, 3]
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"description": "can override other user-defined words",
|
296
|
+
"input": [
|
297
|
+
": foo dup ;",
|
298
|
+
": foo dup dup ;",
|
299
|
+
"1 foo"
|
300
|
+
],
|
301
|
+
"expected": [1, 1, 1]
|
302
|
+
},
|
303
|
+
{
|
304
|
+
"description": "can override built-in words",
|
305
|
+
"input": [
|
306
|
+
": swap dup ;",
|
307
|
+
"1 swap"
|
308
|
+
],
|
309
|
+
"expected": [1, 1]
|
310
|
+
},
|
311
|
+
{
|
312
|
+
"description": "can consist of arbitrary characters such as Unicode characters",
|
313
|
+
"input": [
|
314
|
+
": € 220371 ; €"
|
315
|
+
],
|
316
|
+
"expected": [220371]
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"description": "cannot redefine numbers",
|
320
|
+
"input": [
|
321
|
+
": 1 2 ;"
|
322
|
+
],
|
323
|
+
"expected": null
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"description": "errors if executing a non-existent word",
|
327
|
+
"input": [
|
328
|
+
"foo"
|
329
|
+
],
|
330
|
+
"expected": null
|
331
|
+
}
|
332
|
+
]
|
333
|
+
}
|
334
|
+
}
|
data/lib/trackler/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.2.
|
4
|
+
version: 1.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
@@ -195,6 +195,7 @@ files:
|
|
195
195
|
- common/exercises/food-chain/canonical-data.json
|
196
196
|
- common/exercises/food-chain/description.md
|
197
197
|
- common/exercises/food-chain/metadata.yml
|
198
|
+
- common/exercises/forth/canonical-data.json
|
198
199
|
- common/exercises/forth/description.md
|
199
200
|
- common/exercises/forth/metadata.yml
|
200
201
|
- common/exercises/gigasecond/canonical-data.json
|