init: archlens — architecture diagram generator
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Hex arch + DDD, tree-sitter parsing, Mermaid/ASCII output. Supports Rust + Python. 92 tests. CI, diff, --check for staleness detection.
This commit is contained in:
29
crates/domain/tests/file_path_tests.rs
Normal file
29
crates/domain/tests/file_path_tests.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use archlens_domain::FilePath;
|
||||
|
||||
#[test]
|
||||
fn valid_file_path_is_created() {
|
||||
let path = FilePath::new("src/main.rs").unwrap();
|
||||
assert_eq!(path.as_str(), "src/main.rs");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_file_path_is_rejected() {
|
||||
let result = FilePath::new("");
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn whitespace_only_file_path_is_rejected() {
|
||||
let result = FilePath::new(" ");
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn file_paths_are_comparable() {
|
||||
let a = FilePath::new("src/main.rs").unwrap();
|
||||
let b = FilePath::new("src/main.rs").unwrap();
|
||||
let c = FilePath::new("src/lib.rs").unwrap();
|
||||
|
||||
assert_eq!(a, b);
|
||||
assert_ne!(a, c);
|
||||
}
|
||||
Reference in New Issue
Block a user