Skip to content

Commit 72e4e4a

Browse files
committed
Add ui test
1 parent f4f31a4 commit 72e4e4a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/ui/suspicious_map.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![warn(clippy::suspicious_map)]
2+
3+
fn main() {
4+
let _ = (0..3).map(|x| x + 2).count();
5+
}

tests/ui/suspicious_map.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: Make sure you did not confuse `map` with `filter`.
2+
--> $DIR/suspicious_map.rs:4:13
3+
|
4+
LL | let _ = (0..3).map(|x| x + 2).count();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `-D clippy::suspicious-map` implied by `-D warnings`
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)