Skip to content

Commit 9b0e552

Browse files
committed
Fix test on Windows
1 parent 2c71b63 commit 9b0e552

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

0 commit comments

Comments
 (0)