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
19 changes: 16 additions & 3 deletions exercises/practice/two-bucket/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

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

[58d70152-bf2b-46bb-ad54-be58ebe94c03]
description = "Measure using bucket one much bigger than bucket two"

[9dbe6499-caa5-4a58-b5ce-c988d71b8981]
description = "Measure using bucket one much smaller than bucket two"

[449be72d-b10a-4f4b-a959-ca741e333b72]
description = "Not possible to reach the goal"

Expand Down
16 changes: 16 additions & 0 deletions exercises/practice/two-bucket/two_bucket.bats
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ load bats-extra
assert_output "$expected"
}

@test "Measure using bucket one much bigger than bucket two" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
expected="moves: 6, goalBucket: one, otherBucket: 1"
run bash two_bucket.sh 5 1 2 "one"
assert_success
assert_output "$expected"
}

@test "Measure using bucket one much smaller than bucket two" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
expected="moves: 6, goalBucket: two, otherBucket: 0"
run bash two_bucket.sh 3 15 9 "one"
assert_success
assert_output "$expected"
}

@test "Not possible to reach the goal" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run bash two_bucket.sh 6 15 5 "one"
Expand Down