2023-04-11 08:31:08 -05:00
|
|
|
#![allow(unused)]
|
|
|
|
#![warn(clippy::tests_outside_test_module)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// test code goes here
|
|
|
|
}
|
|
|
|
|
|
|
|
// Should lint
|
|
|
|
#[test]
|
|
|
|
fn my_test() {}
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: this function marked with #[test] is outside a #[cfg(test)] module
|
|
|
|
//~| NOTE: move it to a testing module marked with #[cfg(test)]
|
2023-04-11 08:31:08 -05:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
// Should not lint
|
|
|
|
#[test]
|
|
|
|
fn my_test() {}
|
|
|
|
}
|