Skip to content

Commit 31a7505

Browse files
committed
sync two-bucket tests
1 parent ba64cdb commit 31a7505

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#
99
# As user-added comments (using the # character) will be removed when this file
1010
# is regenerated, comments can be added via a `comment` key.
11+
1112
[a6f2b4ba-065f-4dca-b6f0-e3eee51cb661]
1213
description = "Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one"
1314

@@ -26,6 +27,12 @@ description = "Measure one step using bucket one of size 1 and bucket two of siz
2627
[eb329c63-5540-4735-b30b-97f7f4df0f84]
2728
description = "Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two"
2829

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+
2936
[449be72d-b10a-4f4b-a959-ca741e333b72]
3037
description = "Not possible to reach the goal"
3138

exercises/practice/two-bucket/test/two_bucket_test.exs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,30 @@ defmodule TwoBucketTest do
7373
assert output == expected
7474
end
7575

76+
@tag :pending
77+
test "Measure using bucket one much bigger than bucket two" do
78+
bucket_one = 5
79+
bucket_two = 1
80+
goal = 2
81+
start_bucket = :one
82+
output = TwoBucket.measure(bucket_one, bucket_two, goal, start_bucket)
83+
expected = {:ok, %TwoBucket{bucket_one: goal, bucket_two: 1, moves: 6}}
84+
85+
assert output == expected
86+
end
87+
88+
@tag :pending
89+
test "Measure using bucket one much smaller than bucket two" do
90+
bucket_one = 3
91+
bucket_two = 15
92+
goal = 9
93+
start_bucket = :one
94+
output = TwoBucket.measure(bucket_one, bucket_two, goal, start_bucket)
95+
expected = {:ok, %TwoBucket{bucket_one: 0, bucket_two: goal, moves: 6}}
96+
97+
assert output == expected
98+
end
99+
76100
@tag :pending
77101
test "Not possible to reach the goal" do
78102
bucket_one = 6

0 commit comments

Comments
 (0)