pub mod adapter;
pub use adapter::*;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_normalize_path_for_query() {
let result = normalize_path_for_query("./src/lib.rs");
assert!(result.ends_with("src/lib.rs") || result == "src/lib.rs");
let result = normalize_path_for_query("nonexistent//lib.rs");
assert!(!result.contains("//"));
let result = normalize_path_for_query("nonexistent\\lib.rs");
assert!(!result.contains("\\"));
}
#[test]
fn test_paths_equivalent() {
assert!(paths_equivalent(
"./nonexistent/lib.rs",
"nonexistent/lib.rs"
));
assert!(paths_equivalent(
"nonexistent//lib.rs",
"nonexistent/lib.rs"
));
}
#[test]
fn test_normalize_path_fallback() {
let result = normalize_path_for_query("");
assert!(result.is_empty() || result == "");
}
#[test]
fn test_symbol_lookup_result_counts() {
let result = SymbolLookupResult::NotFound;
assert_eq!(result.count(), 0);
assert!(result.is_not_found());
}
#[test]
fn test_resolve_error_display() {
let err = ResolveError::NotFound {
identifier: "foo".to_string(),
reason: "not found".to_string(),
};
assert_eq!(format!("{}", err), "Symbol 'foo' not found: not found");
let err = ResolveError::Ambiguous {
identifier: "foo".to_string(),
candidates: vec![1, 2, 3],
hint: "use FQN".to_string(),
};
let msg = format!("{}", err);
assert!(msg.contains("Ambiguous reference to 'foo'"));
assert!(msg.contains("3 candidates"));
}
}