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.
30 lines
654 B
Rust
30 lines
654 B
Rust
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);
|
|
}
|