add test case for filter+count

This commit is contained in:
Andre Bogus 2017-01-18 13:55:47 +01:00
parent 27f76157aa
commit b40432c949

View File

@ -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];