From 4ed6b6159771a77c7cd3d1d16c1120e5dd06b38b Mon Sep 17 00:00:00 2001 From: Isaac Good Date: Sun, 25 May 2025 23:18:13 -0700 Subject: [PATCH] Sync `crypto-square` and `largest-series-product` tests --- exercises/practice/crypto-square/.meta/tests.toml | 5 +++++ exercises/practice/crypto-square/crypto_square.bats | 2 +- .../practice/largest-series-product/.meta/example.sh | 2 +- .../practice/largest-series-product/.meta/tests.toml | 10 ++++++++++ .../largest-series-product/largest_series_product.bats | 4 ++-- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/exercises/practice/crypto-square/.meta/tests.toml b/exercises/practice/crypto-square/.meta/tests.toml index 085d142e..94ef0819 100644 --- a/exercises/practice/crypto-square/.meta/tests.toml +++ b/exercises/practice/crypto-square/.meta/tests.toml @@ -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" diff --git a/exercises/practice/crypto-square/crypto_square.bats b/exercises/practice/crypto-square/crypto_square.bats index 6e204278..3fbc3434 100644 --- a/exercises/practice/crypto-square/crypto_square.bats +++ b/exercises/practice/crypto-square/crypto_square.bats @@ -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 diff --git a/exercises/practice/largest-series-product/.meta/example.sh b/exercises/practice/largest-series-product/.meta/example.sh index 4564cca6..bcfa0961 100644 --- a/exercises/practice/largest-series-product/.meta/example.sh +++ b/exercises/practice/largest-series-product/.meta/example.sh @@ -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 diff --git a/exercises/practice/largest-series-product/.meta/tests.toml b/exercises/practice/largest-series-product/.meta/tests.toml index 88316925..982f517c 100644 --- a/exercises/practice/largest-series-product/.meta/tests.toml +++ b/exercises/practice/largest-series-product/.meta/tests.toml @@ -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)" @@ -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" diff --git a/exercises/practice/largest-series-product/largest_series_product.bats b/exercises/practice/largest-series-product/largest_series_product.bats index 3c77b84b..690399c8 100644 --- a/exercises/practice/largest-series-product/largest_series_product.bats +++ b/exercises/practice/largest-series-product/largest_series_product.bats @@ -81,7 +81,7 @@ 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" } @@ -89,7 +89,7 @@ load bats-extra @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" }