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
7 changes: 7 additions & 0 deletions exercises/practice/two-bucket/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#
# 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 @@ -26,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
24 changes: 24 additions & 0 deletions exercises/practice/two-bucket/test/two_bucket_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ defmodule TwoBucketTest do
assert output == expected
end

@tag :pending
test "Measure using bucket one much bigger than bucket two" do
bucket_one = 5
bucket_two = 1
goal = 2
start_bucket = :one
output = TwoBucket.measure(bucket_one, bucket_two, goal, start_bucket)
expected = {:ok, %TwoBucket{bucket_one: goal, bucket_two: 1, moves: 6}}

assert output == expected
end

@tag :pending
test "Measure using bucket one much smaller than bucket two" do
bucket_one = 3
bucket_two = 15
goal = 9
start_bucket = :one
output = TwoBucket.measure(bucket_one, bucket_two, goal, start_bucket)
expected = {:ok, %TwoBucket{bucket_one: 0, bucket_two: goal, moves: 6}}

assert output == expected
end

@tag :pending
test "Not possible to reach the goal" do
bucket_one = 6
Expand Down
Loading