diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-02-02 19:05:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 12:05:46 +0100 |
commit | 6abf126c2a7a451cded8c6b5e6ddf1b69c84055d (patch) | |
tree | fd94c013a19fcb38954844085821ec1601c20e18 /std/path/from_file_url_test.ts | |
parent | a2b5d44f1aa9d64f448a2a3cc2001272e2f60b98 (diff) |
chore: remove std directory (#9361)
This removes the std folder from the tree.
Various parts of the tests are pretty tightly dependent
on std (47 direct imports and 75 indirect imports, not
counting the cli tests that use them as fixtures) so I've
added std as a submodule for now.
Diffstat (limited to 'std/path/from_file_url_test.ts')
-rw-r--r-- | std/path/from_file_url_test.ts | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/std/path/from_file_url_test.ts b/std/path/from_file_url_test.ts deleted file mode 100644 index 61a45a89b..000000000 --- a/std/path/from_file_url_test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { posix, win32 } from "./mod.ts"; -import { assertEquals, assertThrows } from "../testing/asserts.ts"; - -Deno.test("[path] fromFileUrl", function () { - assertEquals(posix.fromFileUrl(new URL("file:///home/foo")), "/home/foo"); - assertEquals(posix.fromFileUrl("file:///"), "/"); - assertEquals(posix.fromFileUrl("file:///home/foo"), "/home/foo"); - assertEquals(posix.fromFileUrl("file:///home/foo%20bar"), "/home/foo bar"); - assertEquals(posix.fromFileUrl("file:///%"), "/%"); - assertEquals(posix.fromFileUrl("file://localhost/foo"), "/foo"); - assertEquals(posix.fromFileUrl("file:///C:"), "/C:"); - assertEquals(posix.fromFileUrl("file:///C:/"), "/C:/"); - assertEquals(posix.fromFileUrl("file:///C:/Users/"), "/C:/Users/"); - assertEquals(posix.fromFileUrl("file:///C:foo/bar"), "/C:foo/bar"); - assertThrows( - () => posix.fromFileUrl("http://localhost/foo"), - TypeError, - "Must be a file URL.", - ); - assertThrows( - () => posix.fromFileUrl("abcd://localhost/foo"), - TypeError, - "Must be a file URL.", - ); -}); - -Deno.test("[path] fromFileUrl (win32)", function () { - assertEquals(win32.fromFileUrl(new URL("file:///home/foo")), "\\home\\foo"); - assertEquals(win32.fromFileUrl("file:///"), "\\"); - assertEquals(win32.fromFileUrl("file:///home/foo"), "\\home\\foo"); - assertEquals(win32.fromFileUrl("file:///home/foo%20bar"), "\\home\\foo bar"); - assertEquals(win32.fromFileUrl("file:///%"), "\\%"); - assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\\\localhost\\foo"); - assertEquals(win32.fromFileUrl("file:///C:"), "C:\\"); - assertEquals(win32.fromFileUrl("file:///C:/"), "C:\\"); - // Drop the hostname if a drive letter is parsed. - assertEquals(win32.fromFileUrl("file://localhost/C:/"), "C:\\"); - assertEquals(win32.fromFileUrl("file:///C:/Users/"), "C:\\Users\\"); - assertEquals(win32.fromFileUrl("file:///C:foo/bar"), "\\C:foo\\bar"); - assertThrows( - () => win32.fromFileUrl("http://localhost/foo"), - TypeError, - "Must be a file URL.", - ); - assertThrows( - () => win32.fromFileUrl("abcd://localhost/foo"), - TypeError, - "Must be a file URL.", - ); -}); |