tidy/
tests_placement.rs

1use std::path::Path;
2
3const FORBIDDEN_PATH: &str = "src/test";
4const ALLOWED_PATH: &str = "tests";
5
6pub fn check(root_path: impl AsRef<Path>, bad: &mut bool) {
7    if root_path.as_ref().join(FORBIDDEN_PATH).exists() {
8        tidy_error!(
9            bad,
10            "Tests have been moved, please move them from {} to {}",
11            root_path.as_ref().join(FORBIDDEN_PATH).display(),
12            root_path.as_ref().join(ALLOWED_PATH).display()
13        )
14    }
15}