diff options
author | Ali Hasani <a.hassssani@gmail.com> | 2020-04-30 15:17:53 +0430 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 12:47:53 +0200 |
commit | c569d958aaf49db70856a60d75954c83ab8bd95a (patch) | |
tree | 80b61ce571ba0fbaeb0df1ed46febf99b743e3fa /std/fs | |
parent | 4bc9c18fe96a30f2fb8262e3ea139ce628b7f4e5 (diff) |
fix(std): use fromFileUrl (#5005)
Diffstat (limited to 'std/fs')
-rw-r--r-- | std/fs/expand_glob_test.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/std/fs/expand_glob_test.ts b/std/fs/expand_glob_test.ts index 98abe0d73..4a1adc308 100644 --- a/std/fs/expand_glob_test.ts +++ b/std/fs/expand_glob_test.ts @@ -2,11 +2,11 @@ const { cwd, execPath, run } = Deno; import { decode } from "../encoding/utf8.ts"; import { assert, assertEquals, assertStrContains } from "../testing/asserts.ts"; import { - isWindows, join, joinGlobs, normalize, relative, + fromFileUrl, } from "../path/mod.ts"; import { ExpandGlobOptions, @@ -39,13 +39,8 @@ async function expandGlobArray( return relativePaths; } -function urlToFilePath(url: URL): string { - // Since `new URL('file:///C:/a').pathname` is `/C:/a`, remove leading slash. - return url.pathname.slice(url.protocol == "file:" && isWindows ? 1 : 0); -} - const EG_OPTIONS: ExpandGlobOptions = { - root: urlToFilePath(new URL(join("testdata", "glob"), import.meta.url)), + root: fromFileUrl(new URL(join("testdata", "glob"), import.meta.url)), includeDirs: true, extended: false, globstar: false, |