add test case for filter+count
This commit is contained in:
parent
27f76157aa
commit
b40432c949
@ -191,6 +191,12 @@ fn test_iterator_enumerate_count() {
|
||||
assert_eq!(xs.iter().count(), 6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_iterator_filter_count() {
|
||||
let xs = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
||||
assert_eq!(xs.iter().filter(|x| x % 2 == 0).count(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_iterator_peekable() {
|
||||
let xs = vec![0, 1, 2, 3, 4, 5];
|
||||
|
Loading…
Reference in New Issue
Block a user