Skip to content

Commit

Permalink
expand retain tests
Browse files Browse the repository at this point in the history
The tests for `retain` previously examined the element. This adds a test
examining the multiplicity as well.
  • Loading branch information
lonnen committed Nov 13, 2020
1 parent 635ac5e commit e61c624
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test-lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,11 @@ fn test_retain() {

assert_eq!(mset.get(&1), Some(&2usize));
assert_eq!(mset.get(&2), Some(&2usize));

mset.retain(|&_k, v| {
v == 1
});

assert_eq!(mset.elements().len(), 1);
assert_eq!(mset.get(&2), Some(&1usize));
}

0 comments on commit e61c624

Please sign in to comment.