Skip to content

Commit 14a97f9

Browse files
committed
test: windows tests
1 parent 5b3cb43 commit 14a97f9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/util.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Deno.test("invariant returns if all ok", () => {
2626

2727
Deno.test("toFileURL works", () => {
2828
const toPosix = (path: string) => path.replaceAll(SEP, POSIX_SEP);
29-
let cwd = toPosix(Deno.cwd());
29+
const cwd = toPosix(Deno.cwd());
3030

3131
if (Deno.build.os !== "windows") {
3232
assertEquals(toFileURL("/a/b/c"), "file:///a/b/c");
@@ -36,13 +36,11 @@ Deno.test("toFileURL works", () => {
3636
assertEquals(toFileURL("http://./def.ts"), `file://${cwd}/def.ts`);
3737
assertEquals(toFileURL("https://./ghi.ts"), `file://${cwd}/ghi.ts`);
3838
} else {
39-
cwd = `/${cwd}`;
40-
4139
assertEquals(toFileURL("/a/b/c"), "file:///D:/a/b/c");
42-
assertEquals(toFileURL("./d/e/f"), `file://${cwd}/d/e/f`);
43-
assertEquals(toFileURL("../d/e/f"), `file://${toPosix($.path(cwd).join("..").toString())}/d/e/f`);
44-
assertEquals(toFileURL("file://./abc.ts"), `file://${cwd}/abc.ts`);
45-
assertEquals(toFileURL("http://./def.ts"), `file://${cwd}/def.ts`);
46-
assertEquals(toFileURL("https://./ghi.ts"), `file://${cwd}/ghi.ts`);
40+
assertEquals(toFileURL("./d/e/f"), `file:///${cwd}/d/e/f`);
41+
assertEquals(toFileURL("../d/e/f"), `file:///${toPosix($.path(cwd).join("..").toString())}/d/e/f`);
42+
assertEquals(toFileURL("file://./abc.ts"), `file:///${cwd}/abc.ts`);
43+
assertEquals(toFileURL("http://./def.ts"), `file:///${cwd}/def.ts`);
44+
assertEquals(toFileURL("https://./ghi.ts"), `file:///${cwd}/ghi.ts`);
4745
}
4846
});

0 commit comments

Comments
 (0)