Skip to content

Commit

Permalink
fix(hashmap2): Update incorrect assertion (rust-lang#660)
Browse files Browse the repository at this point in the history
The test description says "at least five types of fruit", but the test itself is checking for exactly five types of fruit, which was a bit misleading for newcomers like me :) 

A simple change from "==" to ">=" should do the trick and successfully check for the "at least" condition.
  • Loading branch information
pete-eiger authored and mack committed Dec 28, 2021
1 parent 37557ab commit 577a67d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/collections/hashmap2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ mod tests {
let mut basket = get_fruit_basket();
fruit_basket(&mut basket);
let count_fruit_kinds = basket.len();
assert!(count_fruit_kinds == 5);
assert!(count_fruit_kinds >= 5);
}

#[test]
Expand Down

0 comments on commit 577a67d

Please sign in to comment.