Skip to content

Commit 26fc681

Browse files
authored
Sync crypto-square and largest-series-product tests (#739)
1 parent 7ddac64 commit 26fc681

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

exercises/practice/crypto-square/.meta/tests.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ description = "8 character plaintext results in 3 chunks, the last one with a tr
3232

3333
[fbcb0c6d-4c39-4a31-83f6-c473baa6af80]
3434
description = "54 character plaintext results in 7 chunks, the last two with trailing spaces"
35+
include = false
36+
37+
[33fd914e-fa44-445b-8f38-ff8fbc9fe6e6]
38+
description = "54 character plaintext results in 8 chunks, the last two with trailing spaces"
39+
reimplements = "fbcb0c6d-4c39-4a31-83f6-c473baa6af80"

exercises/practice/crypto-square/crypto_square.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ load bats-extra
5353
assert_output "clu hlt io "
5454
}
5555

56-
@test "54 character plaintext results in 7 chunks, the last two with trailing spaces" {
56+
@test "54 character plaintext results in 8 chunks, the last two with trailing spaces" {
5757
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
5858
run bash crypto_square.sh "If man was meant to stay on the ground, god would have given us roots."
5959
assert_success

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ die() { echo "$*" >&2; exit 1; }
88
nondig="*[^[:digit:]]*" # contains a non-digit
99

1010
[[ $series == $nondig ]] && die "input must only contain digits" # pattern is unquoted
11-
(( span > ${#series} )) && die "span must be smaller than string length"
11+
(( span > ${#series} )) && die "span must not exceed string length"
1212
(( span < 0 )) && die "span must not be negative"
1313

1414
declare -i max=0

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)"
@@ -49,6 +54,11 @@ include = false
4954

5055
[6d96c691-4374-4404-80ee-2ea8f3613dd4]
5156
description = "rejects empty string and nonzero span"
57+
include = false
58+
59+
[6cf66098-a6af-4223-aab1-26aeeefc7402]
60+
description = "rejects empty string and nonzero span"
61+
reimplements = "6d96c691-4374-4404-80ee-2ea8f3613dd4"
5262

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ load bats-extra
8181
@test "rejects span longer than string length" {
8282
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
8383
run bash largest_series_product.sh 123 4
84-
expected="span must be smaller than string length"
84+
expected="span must not exceed string length"
8585
assert_failure
8686
assert_output --partial "$expected"
8787
}
8888

8989
@test "rejects empty string and nonzero span" {
9090
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
9191
run bash largest_series_product.sh "" 1
92-
expected="span must be smaller than string length"
92+
expected="span must not exceed string length"
9393
assert_failure
9494
assert_output --partial "$expected"
9595
}

0 commit comments

Comments
 (0)