ferrous-forge 1.9.6

System-wide Rust development standards enforcer
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Test detection utilities

use std::path::Path;

/// Check if a file is a test file based on its path
pub fn is_test_file(rust_file: &Path) -> bool {
    rust_file
        .to_str()
        .map(|s| s.contains("/tests/") || s.contains("\\tests\\") || s.ends_with("_test.rs"))
        .unwrap_or(false)
}