Skip to content

Commit 9f0fe2c

Browse files
authored
Add new tests to two-bucket (#751)
closes #750
1 parent 96d2253 commit 9f0fe2c

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

exercises/practice/two-bucket/.meta/tests.toml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[a6f2b4ba-065f-4dca-b6f0-e3eee51cb661]
613
description = "Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one"
@@ -20,6 +27,12 @@ description = "Measure one step using bucket one of size 1 and bucket two of siz
2027
[eb329c63-5540-4735-b30b-97f7f4df0f84]
2128
description = "Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two"
2229

30+
[58d70152-bf2b-46bb-ad54-be58ebe94c03]
31+
description = "Measure using bucket one much bigger than bucket two"
32+
33+
[9dbe6499-caa5-4a58-b5ce-c988d71b8981]
34+
description = "Measure using bucket one much smaller than bucket two"
35+
2336
[449be72d-b10a-4f4b-a959-ca741e333b72]
2437
description = "Not possible to reach the goal"
2538

exercises/practice/two-bucket/two_bucket.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,22 @@ load bats-extra
5353
assert_output "$expected"
5454
}
5555

56+
@test "Measure using bucket one much bigger than bucket two" {
57+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
58+
expected="moves: 6, goalBucket: one, otherBucket: 1"
59+
run bash two_bucket.sh 5 1 2 "one"
60+
assert_success
61+
assert_output "$expected"
62+
}
63+
64+
@test "Measure using bucket one much smaller than bucket two" {
65+
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
66+
expected="moves: 6, goalBucket: two, otherBucket: 0"
67+
run bash two_bucket.sh 3 15 9 "one"
68+
assert_success
69+
assert_output "$expected"
70+
}
71+
5672
@test "Not possible to reach the goal" {
5773
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
5874
run bash two_bucket.sh 6 15 5 "one"

0 commit comments

Comments
 (0)