Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions exercises/practice/crypto-square/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ description = "8 character plaintext results in 3 chunks, the last one with a tr

[fbcb0c6d-4c39-4a31-83f6-c473baa6af80]
description = "54 character plaintext results in 7 chunks, the last two with trailing spaces"
include = false

[33fd914e-fa44-445b-8f38-ff8fbc9fe6e6]
description = "54 character plaintext results in 8 chunks, the last two with trailing spaces"
reimplements = "fbcb0c6d-4c39-4a31-83f6-c473baa6af80"
2 changes: 1 addition & 1 deletion exercises/practice/crypto-square/crypto_square.bats
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ load bats-extra
assert_output "clu hlt io "
}

@test "54 character plaintext results in 7 chunks, the last two with trailing spaces" {
@test "54 character plaintext results in 8 chunks, the last two with trailing spaces" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run bash crypto_square.sh "If man was meant to stay on the ground, god would have given us roots."
assert_success
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/largest-series-product/.meta/example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ die() { echo "$*" >&2; exit 1; }
nondig="*[^[:digit:]]*" # contains a non-digit

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

declare -i max=0
Expand Down
10 changes: 10 additions & 0 deletions exercises/practice/largest-series-product/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ description = "reports zero if all spans include zero"

[5d81aaf7-4f67-4125-bf33-11493cc7eab7]
description = "rejects span longer than string length"
include = false

[0ae1ce53-d9ba-41bb-827f-2fceb64f058b]
description = "rejects span longer than string length"
reimplements = "5d81aaf7-4f67-4125-bf33-11493cc7eab7"

[06bc8b90-0c51-4c54-ac22-3ec3893a079e]
description = "reports 1 for empty string and empty product (0 span)"
Expand All @@ -49,6 +54,11 @@ include = false

[6d96c691-4374-4404-80ee-2ea8f3613dd4]
description = "rejects empty string and nonzero span"
include = false

[6cf66098-a6af-4223-aab1-26aeeefc7402]
description = "rejects empty string and nonzero span"
reimplements = "6d96c691-4374-4404-80ee-2ea8f3613dd4"

[7a38f2d6-3c35-45f6-8d6f-12e6e32d4d74]
description = "rejects invalid character in digits"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ load bats-extra
@test "rejects span longer than string length" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run bash largest_series_product.sh 123 4
expected="span must be smaller than string length"
expected="span must not exceed string length"
assert_failure
assert_output --partial "$expected"
}

@test "rejects empty string and nonzero span" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run bash largest_series_product.sh "" 1
expected="span must be smaller than string length"
expected="span must not exceed string length"
assert_failure
assert_output --partial "$expected"
}
Expand Down