use codeint_model::language::SourceSet;
use super::classify;
#[test]
fn classifies_generated_test_and_production_rust_files() {
assert_eq!(
classify("src/proto.rs", "// @generated by prost\npub struct Msg;\n"),
SourceSet::Generated
);
assert_eq!(
classify("tests/proto.rs", "/* DO NOT EDIT */\nfn t() {}\n"),
SourceSet::Generated
);
for path in [
"tests/integration.rs",
"crates/cli/tests/check.rs",
"benches/perf.rs",
"examples/demo.rs",
"src/parser/tests.rs",
"src/foo_test.rs",
"src/foo_tests.rs",
] {
assert_eq!(classify(path, "fn main() {}\n"), SourceSet::Test, "{path}");
}
for path in ["src/lib.rs", "src/testing.rs", "src/test_helpers.rs"] {
assert_eq!(
classify(path, "fn run() {}\n"),
SourceSet::Production,
"{path}"
);
}
}