Skip to content

Commit

Permalink
Add ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystucki committed Aug 15, 2019
1 parent f4f31a4 commit 72e4e4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ui/suspicious_map.rs
@@ -0,0 +1,5 @@
#![warn(clippy::suspicious_map)]

fn main() {
let _ = (0..3).map(|x| x + 2).count();
}
10 changes: 10 additions & 0 deletions tests/ui/suspicious_map.stderr
@@ -0,0 +1,10 @@
error: Make sure you did not confuse `map` with `filter`.
--> $DIR/suspicious_map.rs:4:13
|
LL | let _ = (0..3).map(|x| x + 2).count();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::suspicious-map` implied by `-D warnings`

error: aborting due to previous error

0 comments on commit 72e4e4a

Please sign in to comment.