Skip to content

Commit 9eb4501

Browse files
authored
two-bucket: sync tests (#2097)
closes #2096
1 parent 8633954 commit 9eb4501

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ description = "Measure one step using bucket one of size 1 and bucket two of siz
2727
[eb329c63-5540-4735-b30b-97f7f4df0f84]
2828
description = "Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two"
2929

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

exercises/practice/two-bucket/tests/two_bucket.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,30 @@ fn measure_using_bucket_one_of_size_2_and_bucket_two_of_size_3_start_with_bucket
7272
assert_eq!(output, expected);
7373
}
7474

75+
#[test]
76+
#[ignore]
77+
fn measure_using_bucket_one_much_bigger_than_bucket_two() {
78+
let output = solve(5, 1, 2, &Bucket::One);
79+
let expected = Some(BucketStats {
80+
moves: 6,
81+
goal_bucket: Bucket::One,
82+
other_bucket: 1,
83+
});
84+
assert_eq!(output, expected);
85+
}
86+
87+
#[test]
88+
#[ignore]
89+
fn measure_using_bucket_one_much_smaller_than_bucket_two() {
90+
let output = solve(3, 15, 9, &Bucket::One);
91+
let expected = Some(BucketStats {
92+
moves: 6,
93+
goal_bucket: Bucket::Two,
94+
other_bucket: 0,
95+
});
96+
assert_eq!(output, expected);
97+
}
98+
7599
#[test]
76100
#[ignore]
77101
fn not_possible_to_reach_the_goal() {

0 commit comments

Comments
 (0)