Skip to content

Commit 77b1a95

Browse files
Murariclaude
andcommitted
Fix test_doc_index_root: canonicalize both sides for Windows 8.3 paths
Windows temp dirs use 8.3 short names (RUNNER~1 vs runneradmin). Canonicalize both idx.root() and tmp.path() before comparing to resolve short names, \\?\ prefixes, and symlinks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dfa99c4 commit 77b1a95

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

crates/infigraph-docs/tests/pipeline_store_gaps.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,11 @@ fn test_doc_format_as_str_all() {
6262
fn test_doc_index_root() {
6363
let tmp = tempfile::tempdir().unwrap();
6464
let idx = DocIndex::open(tmp.path()).unwrap();
65+
let root = idx.root().canonicalize().unwrap_or_else(|_| idx.root().to_path_buf());
6566
let expected = tmp.path().canonicalize().unwrap();
66-
let root_str = idx.root().to_string_lossy().to_string();
67-
let mut expected_str = expected.to_string_lossy().to_string();
68-
// macOS: canonicalize() may prepend /private to /var/folders tmpdir
69-
expected_str = expected_str.trim_start_matches("/private").to_string();
70-
// Windows: canonicalize() prepends \\?\ extended-length path prefix
71-
expected_str = expected_str.trim_start_matches(r"\\?\").to_string();
72-
assert!(
73-
root_str.ends_with(&expected_str),
74-
"root {root_str} should match {expected_str}"
67+
assert_eq!(
68+
root, expected,
69+
"root {:?} should match {:?}",
70+
root, expected
7571
);
7672
}

0 commit comments

Comments
 (0)