test: Add unit tests for config merging and project name sanitization (#6)

* test: Add unit tests for config merging and project name sanitization

* Update src/utils/project.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: Update assertion for follow_symlinks in scanner configuration

* test: Fix typo in test function name for project info retrieval

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Eli Peter 2025-06-24 23:18:01 +02:00 committed by GitHub
parent a0c9d0f9d4
commit 8497800b13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 140 additions and 1 deletions

View file

@ -12,3 +12,19 @@ pub fn lowercase_ext(path: &std::path::Path) -> Option<&'static str> {
_ => None,
})
}
#[test]
fn lowercase_ext_recognises_known_extensions() {
let cases = [
("file.rs", Some("rs")),
("FILE.RS", Some("rs")),
("main.cpp", Some("cpp")),
("script.PY",Some("py")),
("index.tsx",Some("ts")),
("style.css",None), // unsupported
];
for (file, expected) in cases {
assert_eq!(lowercase_ext(std::path::Path::new(file)), expected, "case: {file}");
}
}