summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/tests_outside_test_module.rs
blob: 1982b1d0107f8c473904885a7489622c2681daca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// compile-flags: --test
#![allow(unused)]
#![warn(clippy::tests_outside_test_module)]

fn main() {
    // test code goes here
}

// Should lint
#[test]
fn my_test() {}

#[cfg(test)]
mod tests {
    // Should not lint
    #[test]
    fn my_test() {}
}