Skip to content

Commit 69415c8

Browse files
authored
Sync (#756)
* sync flower-field * sync isbn-verifier
1 parent e72cc75 commit 69415c8

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

exercises/practice/flower-field/.meta/tests.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ description = "cross"
4545

4646
[dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8]
4747
description = "large garden"
48+
49+
[6e4ac13a-3e43-4728-a2e3-3551d4b1a996]
50+
description = "multiple adjacent flowers"

exercises/practice/flower-field/flower_field.bats

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,9 @@ join() {
187187
assert_output "$(join "${expected[@]}")"
188188
}
189189

190+
@test "multiple adjacent flowers" {
191+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
192+
run bash flower_field.sh " ** "
193+
assert_success
194+
assert_output "1**1"
195+
}

exercises/practice/isbn-verifier/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero"
3030
[28025280-2c39-4092-9719-f3234b89c627]
3131
description = "X is only valid as a check digit"
3232

33+
[8005b57f-f194-44ee-88d2-a77ac4142591]
34+
description = "only one check digit is allowed"
35+
36+
[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
37+
description = "X is not substituted by the value 10"
38+
3339
[f6294e61-7e79-46b3-977b-f48789a4945b]
3440
description = "valid isbn without separating dashes"
3541

exercises/practice/isbn-verifier/isbn_verifier.bats

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ load bats-extra
5252
assert_output "false"
5353
}
5454

55+
@test 'only one check digit is allowed' {
56+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
57+
run bash isbn_verifier.sh '3-598-21508-96'
58+
assert_success
59+
assert_output "false"
60+
}
61+
62+
@test 'X is not substituted by the value 10' {
63+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
64+
run bash isbn_verifier.sh '3-598-2X507-5'
65+
assert_success
66+
assert_output "false"
67+
}
68+
5569
@test 'valid isbn without separating dashes' {
5670
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
5771
run bash isbn_verifier.sh '3598215088'

0 commit comments

Comments
 (0)