Skip to content

Commit 399f3f3

Browse files
committed
Fix test on Windows
1 parent 644b1b5 commit 399f3f3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

crates/oak_ide/tests/integration/goto_definition.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ use oak_scan::DbExt;
1616
use url::Url;
1717

1818
fn file_url(name: &str) -> Url {
19-
Url::parse(&format!("file:///project/R/{name}")).unwrap()
19+
// `Url::to_file_path` on Windows requires a drive-letter prefix, so
20+
// synthesize one for tests. Linux is happy with rootless paths.
21+
if cfg!(windows) {
22+
Url::parse(&format!("file:///C:/project/R/{name}")).unwrap()
23+
} else {
24+
Url::parse(&format!("file:///project/R/{name}")).unwrap()
25+
}
2026
}
2127

2228
fn upsert(db: &mut OakDatabase, name: &str, contents: &str) -> File {

0 commit comments

Comments
 (0)