From c569d958aaf49db70856a60d75954c83ab8bd95a Mon Sep 17 00:00:00 2001 From: Ali Hasani Date: Thu, 30 Apr 2020 15:17:53 +0430 Subject: fix(std): use fromFileUrl (#5005) --- std/fs/expand_glob_test.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'std/fs/expand_glob_test.ts') 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, -- cgit v1.2.3