mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
19 lines
370 B
Rust
19 lines
370 B
Rust
#![allow(unused)]
|
|
#![warn(clippy::tests_outside_test_module)]
|
|
|
|
fn main() {
|
|
// test code goes here
|
|
}
|
|
|
|
// Should lint
|
|
#[test]
|
|
fn my_test() {}
|
|
//~^ ERROR: this function marked with #[test] is outside a #[cfg(test)] module
|
|
//~| NOTE: move it to a testing module marked with #[cfg(test)]
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
// Should not lint
|
|
#[test]
|
|
fn my_test() {}
|
|
}
|