Skip to content

Commit 35f2156

Browse files
committed
Fix test on Windows
1 parent d63023f commit 35f2156

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

crates/oak_scan/src/tests/scheduler.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ fn test_set_workspace_paths_inserts_empty_root_immediately() {
262262
let roots = db.workspace_roots().roots(&db).clone();
263263
assert_eq!(roots.len(), 1);
264264
assert!(roots[0].packages(&db).is_empty());
265-
// Path matches (canonicalized; macOS prefixes with `/private`).
266-
let expected = tmp.path().canonicalize().unwrap();
267-
assert_eq!(roots[0].path(&db).to_file_path().unwrap(), expected);
265+
// Path matches. Compare via the URL conversion the scheduler uses
266+
// internally, so this stays cross-platform: macOS canonicalization
267+
// resolves symlinks (`/var` -> `/private/var`), Windows adds a `\\?\`
268+
// UNC prefix, and going through `UrlId::from_file_path` on both sides
269+
// is the only round-trip that matches.
270+
let expected = UrlId::from_file_path(tmp.path()).unwrap();
271+
assert_eq!(roots[0].path(&db), &expected);
268272
}

0 commit comments

Comments
 (0)