trackler 2.0.8.15 → 2.0.8.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/clock/canonical-data.json +473 -425
- data/common/exercises/crypto-square/canonical-data.json +105 -95
- data/common/exercises/difference-of-squares/canonical-data.json +76 -62
- data/common/exercises/etl/canonical-data.json +67 -59
- data/common/exercises/meetup/canonical-data.json +859 -762
- data/common/exercises/meetup/description.md +13 -7
- data/common/exercises/minesweeper/canonical-data.json +21 -5
- data/common/exercises/nth-prime/canonical-data.json +23 -16
- data/common/exercises/nucleotide-count/canonical-data.json +49 -41
- data/common/exercises/ocr-numbers/canonical-data.json +204 -183
- data/common/exercises/pascals-triangle/canonical-data.json +38 -27
- data/common/exercises/queen-attack/canonical-data.json +125 -109
- data/common/exercises/rotational-cipher/canonical-data.json +1 -1
- data/common/exercises/triangle/canonical-data.json +103 -74
- data/lib/trackler/version.rb +1 -1
- data/tracks/csharp/docs/TESTS.md +7 -1
- data/tracks/csharp/exercises/{exercises.sln → Exercises.All.sln} +0 -0
- data/tracks/csharp/exercises/Exercises.Default.sln +1433 -0
- data/tracks/csharp/exercises/Exercises.Refactoring.sln +61 -0
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +35 -11
- data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs +2 -2
- data/tracks/delphi/docs/TESTS.md +2 -2
- data/tracks/elixir/exercises/bowling/bowling.exs +1 -1
- data/tracks/fsharp/docs/LEARNING.md +2 -1
- data/tracks/go/config.json +7 -1
- data/tracks/go/exercises/prime-factors/{primefactors_test.go → prime_factors_test.go} +4 -1
- data/tracks/go/exercises/protein-translation/protein_translation_test.go +6 -6
- data/tracks/go/exercises/pythagorean-triplet/example.go +2 -0
- data/tracks/go/exercises/pythagorean-triplet/pythagorean_triplet_test.go +8 -0
- data/tracks/julia/README.md +2 -0
- data/tracks/julia/config.json +9 -0
- data/tracks/julia/exercises/rotational-cipher/HINTS.md +21 -0
- data/tracks/julia/exercises/rotational-cipher/example.jl +16 -0
- data/tracks/julia/exercises/rotational-cipher/rotational-cipher.jl +0 -0
- data/tracks/julia/exercises/rotational-cipher/runtests.jl +51 -0
- data/tracks/ocaml/config.json +5 -0
- data/tracks/ocaml/exercises/connect/.merlin +3 -0
- data/tracks/ocaml/exercises/connect/Makefile +15 -0
- data/tracks/ocaml/exercises/connect/connect.mli +4 -0
- data/tracks/ocaml/exercises/connect/example.ml +80 -0
- data/tracks/ocaml/exercises/connect/test.ml +121 -0
- data/tracks/ocaml/tools/test-generator/templates/connect/template.ml +23 -0
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +2 -0
- data/tracks/python/exercises/luhn/example.py +5 -8
- data/tracks/python/exercises/luhn/luhn_test.py +34 -24
- data/tracks/ruby/README.md +138 -23
- metadata +16 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88caa91880583c69357692f1686df34e93146459
|
4
|
+
data.tar.gz: 9786bc1164d764970f93a67062c86be22524b479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11c4be86a064e49932ee781929f654480e36c50d289a6fcabfb6b92edd64ab1e4ed374b31c4fa76e4b28e1826efa937563885f193c34af9b6e77c512d3af0429
|
7
|
+
data.tar.gz: 56bd0e55882ffb03f724727c932c7e31471cb1b6012e6f2f29e94e08d10f318dd3198b9b8f0e36a4ae50a4005e3b2610b64cb72b3f34b73c932e9717b56de1df
|
@@ -1,436 +1,484 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
"exercise": "clock",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"comments": [
|
5
|
+
"Most languages require constructing a clock with initial values,",
|
6
|
+
"adding a positive or negative number of minutes, and testing equality",
|
7
|
+
"in some language-native way. Some languages require separate add and",
|
8
|
+
"subtract functions. Negative and out of range values are generally",
|
9
|
+
"expected to wrap around rather than represent errors."
|
10
|
+
],
|
11
|
+
"cases": [
|
12
|
+
{
|
13
|
+
"description": "Test creating a new clock with an initial time.",
|
13
14
|
"cases": [
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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
|
-
|
15
|
+
{
|
16
|
+
"description": "on the hour",
|
17
|
+
"property": "create",
|
18
|
+
"hour": 8,
|
19
|
+
"minute": 0,
|
20
|
+
"expected": "08:00"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"description": "past the hour",
|
24
|
+
"property": "create",
|
25
|
+
"hour": 11,
|
26
|
+
"minute": 9,
|
27
|
+
"expected": "11:09"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"description": "midnight is zero hours",
|
31
|
+
"property": "create",
|
32
|
+
"hour": 24,
|
33
|
+
"minute": 0,
|
34
|
+
"expected": "00:00"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"description": "hour rolls over",
|
38
|
+
"property": "create",
|
39
|
+
"hour": 25,
|
40
|
+
"minute": 0,
|
41
|
+
"expected": "01:00"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"description": "hour rolls over continuously",
|
45
|
+
"property": "create",
|
46
|
+
"hour": 100,
|
47
|
+
"minute": 0,
|
48
|
+
"expected": "04:00"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"description": "sixty minutes is next hour",
|
52
|
+
"property": "create",
|
53
|
+
"hour": 1,
|
54
|
+
"minute": 60,
|
55
|
+
"expected": "02:00"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"description": "minutes roll over",
|
59
|
+
"property": "create",
|
60
|
+
"hour": 0,
|
61
|
+
"minute": 160,
|
62
|
+
"expected": "02:40"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"description": "minutes roll over continuously",
|
66
|
+
"property": "create",
|
67
|
+
"hour": 0,
|
68
|
+
"minute": 1723,
|
69
|
+
"expected": "04:43"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"description": "hour and minutes roll over",
|
73
|
+
"property": "create",
|
74
|
+
"hour": 25,
|
75
|
+
"minute": 160,
|
76
|
+
"expected": "03:40"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"description": "hour and minutes roll over continuously",
|
80
|
+
"property": "create",
|
81
|
+
"hour": 201,
|
82
|
+
"minute": 3001,
|
83
|
+
"expected": "11:01"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"description": "hour and minutes roll over to exactly midnight",
|
87
|
+
"property": "create",
|
88
|
+
"hour": 72,
|
89
|
+
"minute": 8640,
|
90
|
+
"expected": "00:00"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"description": "negative hour",
|
94
|
+
"property": "create",
|
95
|
+
"hour": -1,
|
96
|
+
"minute": 15,
|
97
|
+
"expected": "23:15"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"description": "negative hour rolls over",
|
101
|
+
"property": "create",
|
102
|
+
"hour": -25,
|
103
|
+
"minute": 0,
|
104
|
+
"expected": "23:00"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"description": "negative hour rolls over continuously",
|
108
|
+
"property": "create",
|
109
|
+
"hour": -91,
|
110
|
+
"minute": 0,
|
111
|
+
"expected": "05:00"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"description": "negative minutes",
|
115
|
+
"property": "create",
|
116
|
+
"hour": 1,
|
117
|
+
"minute": -40,
|
118
|
+
"expected": "00:20"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"description": "negative minutes roll over",
|
122
|
+
"property": "create",
|
123
|
+
"hour": 1,
|
124
|
+
"minute": -160,
|
125
|
+
"expected": "22:20"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"description": "negative minutes roll over continuously",
|
129
|
+
"property": "create",
|
130
|
+
"hour": 1,
|
131
|
+
"minute": -4820,
|
132
|
+
"expected": "16:40"
|
133
|
+
},
|
134
|
+
{
|
135
|
+
"description": "negative hour and minutes both roll over",
|
136
|
+
"property": "create",
|
137
|
+
"hour": -25,
|
138
|
+
"minute": -160,
|
139
|
+
"expected": "20:20"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"description": "negative hour and minutes both roll over continuously",
|
143
|
+
"property": "create",
|
144
|
+
"hour": -121,
|
145
|
+
"minute": -5810,
|
146
|
+
"expected": "22:10"
|
147
|
+
}
|
128
148
|
]
|
129
|
-
|
130
|
-
|
131
|
-
"description":
|
132
|
-
"Test adding and subtracting minutes."
|
133
|
-
],
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"description": "Test adding and subtracting minutes.",
|
134
152
|
"cases": [
|
135
|
-
|
136
|
-
|
153
|
+
{
|
154
|
+
"description": "add minutes",
|
155
|
+
"property": "add",
|
156
|
+
"hour": 10,
|
157
|
+
"minute": 0,
|
158
|
+
"add": 3,
|
159
|
+
"expected": "10:03"
|
160
|
+
},
|
161
|
+
{
|
162
|
+
"description": "add no minutes",
|
163
|
+
"property": "add",
|
164
|
+
"hour": 6,
|
165
|
+
"minute": 41,
|
166
|
+
"add": 0,
|
167
|
+
"expected": "06:41"
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"description": "add to next hour",
|
171
|
+
"property": "add",
|
172
|
+
"hour": 0,
|
173
|
+
"minute": 45,
|
174
|
+
"add": 40,
|
175
|
+
"expected": "01:25"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"description": "add more than one hour",
|
179
|
+
"property": "add",
|
180
|
+
"hour": 10,
|
181
|
+
"minute": 0,
|
182
|
+
"add": 61,
|
183
|
+
"expected": "11:01"
|
184
|
+
},
|
185
|
+
{
|
186
|
+
"description": "add more than two hours with carry",
|
187
|
+
"property": "add",
|
188
|
+
"hour": 0,
|
189
|
+
"minute": 45,
|
190
|
+
"add": 160,
|
191
|
+
"expected": "03:25"
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"description": "add across midnight",
|
195
|
+
"property": "add",
|
196
|
+
"hour": 23,
|
197
|
+
"minute": 59,
|
198
|
+
"add": 2,
|
199
|
+
"expected": "00:01"
|
200
|
+
},
|
201
|
+
{
|
202
|
+
"description": "add more than one day (1500 min = 25 hrs)",
|
203
|
+
"property": "add",
|
204
|
+
"hour": 5,
|
205
|
+
"minute": 32,
|
206
|
+
"add": 1500,
|
207
|
+
"expected": "06:32"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"description": "add more than two days",
|
211
|
+
"property": "add",
|
212
|
+
"hour": 1,
|
213
|
+
"minute": 1,
|
214
|
+
"add": 3500,
|
215
|
+
"expected": "11:21"
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"description": "subtract minutes",
|
219
|
+
"property": "add",
|
220
|
+
"hour": 10,
|
221
|
+
"minute": 3,
|
222
|
+
"add": -3,
|
223
|
+
"expected": "10:00"
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"description": "subtract to previous hour",
|
227
|
+
"property": "add",
|
228
|
+
"hour": 10,
|
229
|
+
"minute": 3,
|
230
|
+
"add": -30,
|
231
|
+
"expected": "09:33"
|
232
|
+
},
|
233
|
+
{
|
234
|
+
"description": "subtract more than an hour",
|
235
|
+
"property": "add",
|
236
|
+
"hour": 10,
|
237
|
+
"minute": 3,
|
238
|
+
"add": -70,
|
239
|
+
"expected": "08:53"
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"description": "subtract across midnight",
|
243
|
+
"property": "add",
|
244
|
+
"hour": 0,
|
245
|
+
"minute": 3,
|
246
|
+
"add": -4,
|
247
|
+
"expected": "23:59"
|
248
|
+
},
|
249
|
+
{
|
250
|
+
"description": "subtract more than two hours",
|
251
|
+
"property": "add",
|
252
|
+
"hour": 0,
|
253
|
+
"minute": 0,
|
254
|
+
"add": -160,
|
255
|
+
"expected": "21:20"
|
256
|
+
},
|
257
|
+
{
|
258
|
+
"description": "subtract more than two hours with borrow",
|
259
|
+
"property": "add",
|
260
|
+
"hour": 6,
|
261
|
+
"minute": 15,
|
262
|
+
"add": -160,
|
263
|
+
"expected": "03:35"
|
264
|
+
},
|
265
|
+
{
|
266
|
+
"description": "subtract more than one day (1500 min = 25 hrs)",
|
267
|
+
"property": "add",
|
268
|
+
"hour": 5,
|
269
|
+
"minute": 32,
|
270
|
+
"add": -1500,
|
271
|
+
"expected": "04:32"
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"description": "subtract more than two days",
|
275
|
+
"property": "add",
|
276
|
+
"hour": 2,
|
277
|
+
"minute": 20,
|
278
|
+
"add": -3000,
|
279
|
+
"expected": "00:20"
|
280
|
+
}
|
281
|
+
]
|
282
|
+
},
|
283
|
+
{
|
284
|
+
"description": "Construct two separate clocks, set times, test if they are equal.",
|
285
|
+
"cases": [
|
286
|
+
{
|
287
|
+
"description": "clocks with same time",
|
288
|
+
"property": "equal",
|
289
|
+
"clock1": {
|
290
|
+
"hour": 15,
|
291
|
+
"minute": 37
|
292
|
+
},
|
293
|
+
"clock2": {
|
294
|
+
"hour": 15,
|
295
|
+
"minute": 37
|
296
|
+
},
|
297
|
+
"expected": true
|
298
|
+
},
|
299
|
+
{
|
300
|
+
"description": "clocks a minute apart",
|
301
|
+
"property": "equal",
|
302
|
+
"clock1": {
|
303
|
+
"hour": 15,
|
304
|
+
"minute": 36
|
305
|
+
},
|
306
|
+
"clock2": {
|
307
|
+
"hour": 15,
|
308
|
+
"minute": 37
|
309
|
+
},
|
310
|
+
"expected": false
|
311
|
+
},
|
312
|
+
{
|
313
|
+
"description": "clocks an hour apart",
|
314
|
+
"property": "equal",
|
315
|
+
"clock1": {
|
316
|
+
"hour": 14,
|
317
|
+
"minute": 37
|
318
|
+
},
|
319
|
+
"clock2": {
|
320
|
+
"hour": 15,
|
321
|
+
"minute": 37
|
322
|
+
},
|
323
|
+
"expected": false
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"description": "clocks with hour overflow",
|
327
|
+
"property": "equal",
|
328
|
+
"clock1": {
|
137
329
|
"hour": 10,
|
138
|
-
"minute":
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
"
|
330
|
+
"minute": 37
|
331
|
+
},
|
332
|
+
"clock2": {
|
333
|
+
"hour": 34,
|
334
|
+
"minute": 37
|
335
|
+
},
|
336
|
+
"expected": true
|
337
|
+
},
|
338
|
+
{
|
339
|
+
"description": "clocks with hour overflow by several days",
|
340
|
+
"property": "equal",
|
341
|
+
"clock1": {
|
342
|
+
"hour": 3,
|
343
|
+
"minute": 11
|
344
|
+
},
|
345
|
+
"clock2": {
|
346
|
+
"hour": 99,
|
347
|
+
"minute": 11
|
348
|
+
},
|
349
|
+
"expected": true
|
350
|
+
},
|
351
|
+
{
|
352
|
+
"description": "clocks with negative hour",
|
353
|
+
"property": "equal",
|
354
|
+
"clock1": {
|
355
|
+
"hour": 22,
|
356
|
+
"minute": 40
|
357
|
+
},
|
358
|
+
"clock2": {
|
359
|
+
"hour": -2,
|
360
|
+
"minute": 40
|
361
|
+
},
|
362
|
+
"expected": true
|
363
|
+
},
|
364
|
+
{
|
365
|
+
"description": "clocks with negative hour that wraps",
|
366
|
+
"property": "equal",
|
367
|
+
"clock1": {
|
368
|
+
"hour": 17,
|
369
|
+
"minute": 3
|
370
|
+
},
|
371
|
+
"clock2": {
|
372
|
+
"hour": -31,
|
373
|
+
"minute": 3
|
374
|
+
},
|
375
|
+
"expected": true
|
376
|
+
},
|
377
|
+
{
|
378
|
+
"description": "clocks with negative hour that wraps multiple times",
|
379
|
+
"property": "equal",
|
380
|
+
"clock1": {
|
381
|
+
"hour": 13,
|
382
|
+
"minute": 49
|
383
|
+
},
|
384
|
+
"clock2": {
|
385
|
+
"hour": -83,
|
386
|
+
"minute": 49
|
387
|
+
},
|
388
|
+
"expected": true
|
389
|
+
},
|
390
|
+
{
|
391
|
+
"description": "clocks with minute overflow",
|
392
|
+
"property": "equal",
|
393
|
+
"clock1": {
|
151
394
|
"hour": 0,
|
152
|
-
"minute":
|
153
|
-
|
154
|
-
|
155
|
-
},
|
156
|
-
{
|
157
|
-
"description": "add more than one hour",
|
158
|
-
"hour": 10,
|
159
|
-
"minute": 0,
|
160
|
-
"add": 61,
|
161
|
-
"expected": "11:01"
|
162
|
-
},
|
163
|
-
{
|
164
|
-
"description": "add more than two hours with carry",
|
395
|
+
"minute": 1
|
396
|
+
},
|
397
|
+
"clock2": {
|
165
398
|
"hour": 0,
|
166
|
-
"minute":
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
"
|
175
|
-
"
|
176
|
-
|
177
|
-
|
178
|
-
"
|
399
|
+
"minute": 1441
|
400
|
+
},
|
401
|
+
"expected": true
|
402
|
+
},
|
403
|
+
{
|
404
|
+
"description": "clocks with minute overflow by several days",
|
405
|
+
"property": "equal",
|
406
|
+
"clock1": {
|
407
|
+
"hour": 2,
|
408
|
+
"minute": 2
|
409
|
+
},
|
410
|
+
"clock2": {
|
411
|
+
"hour": 2,
|
412
|
+
"minute": 4322
|
413
|
+
},
|
414
|
+
"expected": true
|
415
|
+
},
|
416
|
+
{
|
417
|
+
"description": "clocks with negative minute",
|
418
|
+
"property": "equal",
|
419
|
+
"clock1": {
|
420
|
+
"hour": 2,
|
421
|
+
"minute": 40
|
422
|
+
},
|
423
|
+
"clock2": {
|
424
|
+
"hour": 3,
|
425
|
+
"minute": -20
|
426
|
+
},
|
427
|
+
"expected": true
|
428
|
+
},
|
429
|
+
{
|
430
|
+
"description": "clocks with negative minute that wraps",
|
431
|
+
"property": "equal",
|
432
|
+
"clock1": {
|
433
|
+
"hour": 4,
|
434
|
+
"minute": 10
|
435
|
+
},
|
436
|
+
"clock2": {
|
179
437
|
"hour": 5,
|
180
|
-
"minute":
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
"add": 3500,
|
189
|
-
"expected": "11:21"
|
190
|
-
},
|
191
|
-
{
|
192
|
-
"description": "subtract minutes",
|
193
|
-
"hour": 10,
|
194
|
-
"minute": 3,
|
195
|
-
"add": -3,
|
196
|
-
"expected": "10:00"
|
197
|
-
},
|
198
|
-
{
|
199
|
-
"description": "subtract to previous hour",
|
200
|
-
"hour": 10,
|
201
|
-
"minute": 3,
|
202
|
-
"add": -30,
|
203
|
-
"expected": "09:33"
|
204
|
-
},
|
205
|
-
{
|
206
|
-
"description": "subtract more than an hour",
|
207
|
-
"hour": 10,
|
208
|
-
"minute": 3,
|
209
|
-
"add": -70,
|
210
|
-
"expected": "08:53"
|
211
|
-
},
|
212
|
-
{
|
213
|
-
"description": "subtract across midnight",
|
214
|
-
"hour": 0,
|
215
|
-
"minute": 3,
|
216
|
-
"add": -4,
|
217
|
-
"expected": "23:59"
|
218
|
-
},
|
219
|
-
{
|
220
|
-
"description": "subtract more than two hours",
|
221
|
-
"hour": 0,
|
222
|
-
"minute": 0,
|
223
|
-
"add": -160,
|
224
|
-
"expected": "21:20"
|
225
|
-
},
|
226
|
-
{
|
227
|
-
"description": "subtract more than two hours with borrow",
|
438
|
+
"minute": -1490
|
439
|
+
},
|
440
|
+
"expected": true
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"description": "clocks with negative minute that wraps multiple times",
|
444
|
+
"property": "equal",
|
445
|
+
"clock1": {
|
228
446
|
"hour": 6,
|
229
|
-
"minute": 15
|
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
|
-
"expected": true
|
265
|
-
},
|
266
|
-
{
|
267
|
-
"description": "clocks a minute apart",
|
268
|
-
"clock1": {
|
269
|
-
"hour": 15,
|
270
|
-
"minute": 36
|
271
|
-
},
|
272
|
-
"clock2": {
|
273
|
-
"hour": 15,
|
274
|
-
"minute": 37
|
275
|
-
},
|
276
|
-
"expected": false
|
277
|
-
},
|
278
|
-
{
|
279
|
-
"description": "clocks an hour apart",
|
280
|
-
"clock1": {
|
281
|
-
"hour": 14,
|
282
|
-
"minute": 37
|
283
|
-
},
|
284
|
-
"clock2": {
|
285
|
-
"hour": 15,
|
286
|
-
"minute": 37
|
287
|
-
},
|
288
|
-
"expected": false
|
289
|
-
},
|
290
|
-
{
|
291
|
-
"description": "clocks with hour overflow",
|
292
|
-
"clock1": {
|
293
|
-
"hour": 10,
|
294
|
-
"minute": 37
|
295
|
-
},
|
296
|
-
"clock2": {
|
297
|
-
"hour": 34,
|
298
|
-
"minute": 37
|
299
|
-
},
|
300
|
-
"expected": true
|
301
|
-
},
|
302
|
-
{
|
303
|
-
"description": "clocks with hour overflow by several days",
|
304
|
-
"clock1": {
|
305
|
-
"hour": 3,
|
306
|
-
"minute": 11
|
307
|
-
},
|
308
|
-
"clock2": {
|
309
|
-
"hour": 99,
|
310
|
-
"minute": 11
|
311
|
-
},
|
312
|
-
"expected": true
|
313
|
-
},
|
314
|
-
{
|
315
|
-
"description": "clocks with negative hour",
|
316
|
-
"clock1": {
|
317
|
-
"hour": 22,
|
318
|
-
"minute": 40
|
319
|
-
},
|
320
|
-
"clock2": {
|
321
|
-
"hour": -2,
|
322
|
-
"minute": 40
|
323
|
-
},
|
324
|
-
"expected": true
|
325
|
-
},
|
326
|
-
{
|
327
|
-
"description": "clocks with negative hour that wraps",
|
328
|
-
"clock1": {
|
329
|
-
"hour": 17,
|
330
|
-
"minute": 3
|
331
|
-
},
|
332
|
-
"clock2": {
|
333
|
-
"hour": -31,
|
334
|
-
"minute": 3
|
335
|
-
},
|
336
|
-
"expected": true
|
337
|
-
},
|
338
|
-
{
|
339
|
-
"description": "clocks with negative hour that wraps multiple times",
|
340
|
-
"clock1": {
|
341
|
-
"hour": 13,
|
342
|
-
"minute": 49
|
343
|
-
},
|
344
|
-
"clock2": {
|
345
|
-
"hour": -83,
|
346
|
-
"minute": 49
|
347
|
-
},
|
348
|
-
"expected": true
|
349
|
-
},
|
350
|
-
{
|
351
|
-
"description": "clocks with minute overflow",
|
352
|
-
"clock1": {
|
353
|
-
"hour": 0,
|
354
|
-
"minute": 1
|
355
|
-
},
|
356
|
-
"clock2": {
|
357
|
-
"hour": 0,
|
358
|
-
"minute": 1441
|
359
|
-
},
|
360
|
-
"expected": true
|
361
|
-
},
|
362
|
-
{
|
363
|
-
"description": "clocks with minute overflow by several days",
|
364
|
-
"clock1": {
|
365
|
-
"hour": 2,
|
366
|
-
"minute": 2
|
367
|
-
},
|
368
|
-
"clock2": {
|
369
|
-
"hour": 2,
|
370
|
-
"minute": 4322
|
371
|
-
},
|
372
|
-
"expected": true
|
373
|
-
},
|
374
|
-
{
|
375
|
-
"description": "clocks with negative minute",
|
376
|
-
"clock1": {
|
377
|
-
"hour": 2,
|
378
|
-
"minute": 40
|
379
|
-
},
|
380
|
-
"clock2": {
|
381
|
-
"hour": 3,
|
382
|
-
"minute": -20
|
383
|
-
},
|
384
|
-
"expected": true
|
385
|
-
},
|
386
|
-
{
|
387
|
-
"description": "clocks with negative minute that wraps",
|
388
|
-
"clock1": {
|
389
|
-
"hour": 4,
|
390
|
-
"minute": 10
|
391
|
-
},
|
392
|
-
"clock2": {
|
393
|
-
"hour": 5,
|
394
|
-
"minute": -1490
|
395
|
-
},
|
396
|
-
"expected": true
|
397
|
-
},
|
398
|
-
{
|
399
|
-
"description": "clocks with negative minute that wraps multiple times",
|
400
|
-
"clock1": {
|
401
|
-
"hour": 6,
|
402
|
-
"minute": 15
|
403
|
-
},
|
404
|
-
"clock2": {
|
405
|
-
"hour": 6,
|
406
|
-
"minute": -4305
|
407
|
-
},
|
408
|
-
"expected": true
|
409
|
-
},
|
410
|
-
{
|
411
|
-
"description": "clocks with negative hours and minutes",
|
412
|
-
"clock1": {
|
413
|
-
"hour": 7,
|
414
|
-
"minute": 32
|
415
|
-
},
|
416
|
-
"clock2": {
|
417
|
-
"hour": -12,
|
418
|
-
"minute": -268
|
419
|
-
},
|
420
|
-
"expected": true
|
421
|
-
},
|
422
|
-
{
|
423
|
-
"description": "clocks with negative hours and minutes that wrap",
|
424
|
-
"clock1": {
|
425
|
-
"hour": 18,
|
426
|
-
"minute": 7
|
427
|
-
},
|
428
|
-
"clock2": {
|
429
|
-
"hour": -54,
|
430
|
-
"minute": -11513
|
431
|
-
},
|
432
|
-
"expected": true
|
433
|
-
}
|
447
|
+
"minute": 15
|
448
|
+
},
|
449
|
+
"clock2": {
|
450
|
+
"hour": 6,
|
451
|
+
"minute": -4305
|
452
|
+
},
|
453
|
+
"expected": true
|
454
|
+
},
|
455
|
+
{
|
456
|
+
"description": "clocks with negative hours and minutes",
|
457
|
+
"property": "equal",
|
458
|
+
"clock1": {
|
459
|
+
"hour": 7,
|
460
|
+
"minute": 32
|
461
|
+
},
|
462
|
+
"clock2": {
|
463
|
+
"hour": -12,
|
464
|
+
"minute": -268
|
465
|
+
},
|
466
|
+
"expected": true
|
467
|
+
},
|
468
|
+
{
|
469
|
+
"description": "clocks with negative hours and minutes that wrap",
|
470
|
+
"property": "equal",
|
471
|
+
"clock1": {
|
472
|
+
"hour": 18,
|
473
|
+
"minute": 7
|
474
|
+
},
|
475
|
+
"clock2": {
|
476
|
+
"hour": -54,
|
477
|
+
"minute": -11513
|
478
|
+
},
|
479
|
+
"expected": true
|
480
|
+
}
|
434
481
|
]
|
435
|
-
|
482
|
+
}
|
483
|
+
]
|
436
484
|
}
|