Skip to content

Commit b40432c

Browse files
committed
add test case for filter+count
1 parent 27f7615 commit b40432c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcoretest/iter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ fn test_iterator_enumerate_count() {
191191
assert_eq!(xs.iter().count(), 6);
192192
}
193193

194+
#[test]
195+
fn test_iterator_filter_count() {
196+
let xs = [0, 1, 2, 3, 4, 5, 6, 7, 8];
197+
assert_eq!(xs.iter().filter(|x| x % 2 == 0).count(), 5);
198+
}
199+
194200
#[test]
195201
fn test_iterator_peekable() {
196202
let xs = vec![0, 1, 2, 3, 4, 5];

0 commit comments

Comments
 (0)