Skip to content

Commit 5097f17

Browse files
authored
Sync tests flatten-array, largest-series-product (#281)
1 parent 0edb523 commit 5097f17

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

exercises/practice/flatten-array/.meta/tests.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,32 @@ description = "null values are omitted from the final result"
3232

3333
[c6cf26de-8ccd-4410-84bd-b9efd88fd2bc]
3434
description = "consecutive null values at the front of the list are omitted from the final result"
35+
include = false
36+
37+
[bc72da10-5f55-4ada-baf3-50e4da02ec8e]
38+
description = "consecutive null values at the front of the array are omitted from the final result"
39+
reimplements = "c6cf26de-8ccd-4410-84bd-b9efd88fd2bc"
3540

3641
[382c5242-587e-4577-b8ce-a5fb51e385a1]
3742
description = "consecutive null values in the middle of the list are omitted from the final result"
43+
include = false
44+
45+
[6991836d-0d9b-4703-80a0-3f1f23eb5981]
46+
description = "consecutive null values in the middle of the array are omitted from the final result"
47+
reimplements = "382c5242-587e-4577-b8ce-a5fb51e385a1"
3848

3949
[ef1d4790-1b1e-4939-a179-51ace0829dbd]
4050
description = "6 level nest list with null values"
51+
include = false
52+
53+
[dc90a09c-5376-449c-a7b3-c2d20d540069]
54+
description = "6 level nested array with null values"
55+
reimplements = "ef1d4790-1b1e-4939-a179-51ace0829dbd"
4156

4257
[85721643-705a-4150-93ab-7ae398e2942d]
4358
description = "all values in nested list are null"
59+
include = false
60+
61+
[51f5d9af-8f7f-4fb5-a156-69e8282cb275]
62+
description = "all values in nested array are null"
63+
reimplements = "85721643-705a-4150-93ab-7ae398e2942d"

exercises/practice/flatten-array/test-flatten-array.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ END_EXPECTED
221221
assert_equal "$output" "$expected"
222222
}
223223

224-
@test 'consecutive null values at the front of the list are omitted from the final result' {
224+
@test 'consecutive null values at the front of the array are omitted from the final result' {
225225
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
226226

227227
run jq -r -f flatten-array.jq << 'END_INPUT'
@@ -244,7 +244,7 @@ END_EXPECTED
244244
assert_equal "$output" "$expected"
245245
}
246246

247-
@test 'consecutive null values in the middle of the list are omitted from the final result' {
247+
@test 'consecutive null values in the middle of the array are omitted from the final result' {
248248
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
249249

250250
run jq -r -f flatten-array.jq << 'END_INPUT'
@@ -269,7 +269,7 @@ END_EXPECTED
269269
assert_equal "$output" "$expected"
270270
}
271271

272-
@test '6 level nest list with null values' {
272+
@test '6 level nested array with null values' {
273273
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
274274

275275
run jq -r -f flatten-array.jq << 'END_INPUT'
@@ -316,7 +316,7 @@ END_EXPECTED
316316
assert_equal "$output" "$expected"
317317
}
318318

319-
@test 'all values in nested list are null' {
319+
@test 'all values in nested array are null' {
320320
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
321321

322322
run jq -r -f flatten-array.jq << 'END_INPUT'

exercises/practice/largest-series-product/.meta/example.jq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def product:
77
;
88

99
assert(.span >= 0; "span must not be negative")
10-
| assert(.span <= (.digits | length); "span must be smaller than string length")
10+
| assert(.span <= (.digits | length); "span must not exceed string length")
1111
| assert(.digits | test("^\\d*$"); "digits input must only contain digits")
1212

1313
| .span as $span

exercises/practice/largest-series-product/.meta/tests.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ description = "reports zero if all spans include zero"
3838

3939
[5d81aaf7-4f67-4125-bf33-11493cc7eab7]
4040
description = "rejects span longer than string length"
41+
include = false
42+
43+
[0ae1ce53-d9ba-41bb-827f-2fceb64f058b]
44+
description = "rejects span longer than string length"
45+
reimplements = "5d81aaf7-4f67-4125-bf33-11493cc7eab7"
4146

4247
[06bc8b90-0c51-4c54-ac22-3ec3893a079e]
4348
description = "reports 1 for empty string and empty product (0 span)"
@@ -47,6 +52,11 @@ description = "reports 1 for nonempty string and empty product (0 span)"
4752

4853
[6d96c691-4374-4404-80ee-2ea8f3613dd4]
4954
description = "rejects empty string and nonzero span"
55+
include = false
56+
57+
[6cf66098-a6af-4223-aab1-26aeeefc7402]
58+
description = "rejects empty string and nonzero span"
59+
reimplements = "6d96c691-4374-4404-80ee-2ea8f3613dd4"
5060

5161
[7a38f2d6-3c35-45f6-8d6f-12e6e32d4d74]
5262
description = "rejects invalid character in digits"

exercises/practice/largest-series-product/test-largest-series-product.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ END_INPUT
149149
END_INPUT
150150

151151
assert_failure
152-
expected='span must be smaller than string length'
152+
expected='span must not exceed string length'
153153
assert_equal "$output" "$expected"
154154
}
155155

@@ -194,7 +194,7 @@ END_INPUT
194194
END_INPUT
195195

196196
assert_failure
197-
expected='span must be smaller than string length'
197+
expected='span must not exceed string length'
198198
assert_equal "$output" "$expected"
199199
}
200200

0 commit comments

Comments
 (0)