From ac6e7b29577285a4476c9cc34395e4d1d51d3aac Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 21 Jun 2016 14:46:02 +0200 Subject: [PATCH] fix tests --- tests/compile-fail/filter_methods.rs | 9 +++++++-- tests/compile-fail/methods.rs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/compile-fail/filter_methods.rs b/tests/compile-fail/filter_methods.rs index 2a0e4156ceb..8f37a8553b4 100644 --- a/tests/compile-fail/filter_methods.rs +++ b/tests/compile-fail/filter_methods.rs @@ -3,13 +3,18 @@ #![deny(clippy, clippy_pedantic)] fn main() { - let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an Iterator + let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an `Iterator` .filter(|&x| x == 0) .map(|x| x * 2) .collect(); - let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an Iterator + let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an `Iterator` .filter(|&x| x == 0) .flat_map(|x| x.checked_mul(2)) .collect(); + + let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter_map(p).flat_map(q)` on an `Iterator` + .filter_map(|x| x.checked_mul(2)) + .flat_map(|x| x.checked_mul(2)) + .collect(); } diff --git a/tests/compile-fail/methods.rs b/tests/compile-fail/methods.rs index 647cca5a39c..c3f18bef462 100644 --- a/tests/compile-fail/methods.rs +++ b/tests/compile-fail/methods.rs @@ -181,11 +181,11 @@ fn filter_next() { // check single-line case let _ = v.iter().filter(|&x| *x < 0).next(); - //~^ ERROR called `filter(p).next()` on an Iterator. + //~^ ERROR called `filter(p).next()` on an `Iterator`. //~| NOTE replace `filter(|&x| *x < 0).next()` // check multi-line case - let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an Iterator. + let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an `Iterator`. *x < 0 } ).next();