@@ -26,7 +26,7 @@ Deno.test("invariant returns if all ok", () => {
26
26
27
27
Deno . test ( "toFileURL works" , ( ) => {
28
28
const toPosix = ( path : string ) => path . replaceAll ( SEP , POSIX_SEP ) ;
29
- let cwd = toPosix ( Deno . cwd ( ) ) ;
29
+ const cwd = toPosix ( Deno . cwd ( ) ) ;
30
30
31
31
if ( Deno . build . os !== "windows" ) {
32
32
assertEquals ( toFileURL ( "/a/b/c" ) , "file:///a/b/c" ) ;
@@ -36,13 +36,11 @@ Deno.test("toFileURL works", () => {
36
36
assertEquals ( toFileURL ( "http://./def.ts" ) , `file://${ cwd } /def.ts` ) ;
37
37
assertEquals ( toFileURL ( "https://./ghi.ts" ) , `file://${ cwd } /ghi.ts` ) ;
38
38
} else {
39
- cwd = `/${ cwd } ` ;
40
-
41
39
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` ) ;
47
45
}
48
46
} ) ;
0 commit comments