diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs index 99d31293053..05a674e05d5 100644 --- a/src/libcoretest/iter.rs +++ b/src/libcoretest/iter.rs @@ -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];