97001e1544
Move all 29 workspace members from packages/<name>/ to crates/<name>/. Updates: workspace Cargo.toml (members + path deps), justfile, root CLAUDE.md, scripts/build/CARGO_INSTALL.md, docs/architecture/crates.md (renamed from packages.md), structural references in docs/architecture and docs/configuration, per-crate CLAUDE.md self-references. Historical plans, reports, and building/ docs are left untouched. No behavior change; just check-all stays green and fermata tests pass.
40 lines
1.2 KiB
Rust
40 lines
1.2 KiB
Rust
use dirigent_fermata::core::extract::{extract_path_candidates, Confidence};
|
|
|
|
#[test]
|
|
fn extracts_absolute_unix_path() {
|
|
let s = "the file is at /home/user/.env and was modified";
|
|
let cs = extract_path_candidates(s);
|
|
assert!(cs.iter().any(|c| c.text == "/home/user/.env" && c.confidence == Confidence::High));
|
|
}
|
|
|
|
#[test]
|
|
fn extracts_absolute_windows_path() {
|
|
let s = r"see C:\Users\me\secret.toml for details";
|
|
let cs = extract_path_candidates(s);
|
|
assert!(cs.iter().any(|c| c.text == r"C:\Users\me\secret.toml" && c.confidence == Confidence::High));
|
|
}
|
|
|
|
#[test]
|
|
fn extracts_relative_with_separator() {
|
|
let s = "modified src/lib.rs and tests/foo.rs";
|
|
let cs = extract_path_candidates(s);
|
|
let texts: Vec<_> = cs.iter().map(|c| c.text.as_str()).collect();
|
|
assert!(texts.contains(&"src/lib.rs"));
|
|
assert!(texts.contains(&"tests/foo.rs"));
|
|
}
|
|
|
|
#[test]
|
|
fn bare_filename_with_extension_is_low_confidence() {
|
|
let s = "open README.md please";
|
|
let cs = extract_path_candidates(s);
|
|
let r = cs.iter().find(|c| c.text == "README.md").unwrap();
|
|
assert_eq!(r.confidence, Confidence::Low);
|
|
}
|
|
|
|
#[test]
|
|
fn ignores_pure_words() {
|
|
let s = "the quick brown fox";
|
|
let cs = extract_path_candidates(s);
|
|
assert!(cs.is_empty());
|
|
}
|