diff options
| author | Vincent LE GOFF <g_n_s@hotmail.fr> | 2019-03-06 22:39:50 +0100 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-06 16:39:50 -0500 |
| commit | e36edfdb3fd4709358a5f499f13cfe3d53c2b4f7 (patch) | |
| tree | 1baef3f876a5e75288c3ec9056cdb93dd6b5787f /fs/path/extname_test.ts | |
| parent | d29957ad17956016c35a04f5f1f98565e58e8a2e (diff) | |
Testing refactor (denoland/deno_std#240)
Original: https://github.com/denoland/deno_std/commit/e1d5c00279132aa639030c6c6d9b4e308bd4775e
Diffstat (limited to 'fs/path/extname_test.ts')
| -rw-r--r-- | fs/path/extname_test.ts | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/fs/path/extname_test.ts b/fs/path/extname_test.ts index 63d473d34..08f780e7d 100644 --- a/fs/path/extname_test.ts +++ b/fs/path/extname_test.ts @@ -1,7 +1,8 @@ // Copyright the Browserify authors. MIT License. // Ported from https://github.com/browserify/path-browserify/ -import { test, assertEqual } from "../../testing/mod.ts"; +import { test } from "../../testing/mod.ts"; +import { assertEq } from "../../testing/asserts.ts"; import * as path from "./mod.ts"; const slashRE = /\//g; @@ -55,35 +56,35 @@ test(function extname() { pairs.forEach(function(p) { const input = p[0]; const expected = p[1]; - assertEqual(expected, path.posix.extname(input)); + assertEq(expected, path.posix.extname(input)); }); // On *nix, backslash is a valid name component like any other character. - assertEqual(path.posix.extname(".\\"), ""); - assertEqual(path.posix.extname("..\\"), ".\\"); - assertEqual(path.posix.extname("file.ext\\"), ".ext\\"); - assertEqual(path.posix.extname("file.ext\\\\"), ".ext\\\\"); - assertEqual(path.posix.extname("file\\"), ""); - assertEqual(path.posix.extname("file\\\\"), ""); - assertEqual(path.posix.extname("file.\\"), ".\\"); - assertEqual(path.posix.extname("file.\\\\"), ".\\\\"); + assertEq(path.posix.extname(".\\"), ""); + assertEq(path.posix.extname("..\\"), ".\\"); + assertEq(path.posix.extname("file.ext\\"), ".ext\\"); + assertEq(path.posix.extname("file.ext\\\\"), ".ext\\\\"); + assertEq(path.posix.extname("file\\"), ""); + assertEq(path.posix.extname("file\\\\"), ""); + assertEq(path.posix.extname("file.\\"), ".\\"); + assertEq(path.posix.extname("file.\\\\"), ".\\\\"); }); test(function extnameWin32() { pairs.forEach(function(p) { const input = p[0].replace(slashRE, "\\"); const expected = p[1]; - assertEqual(expected, path.win32.extname(input)); - assertEqual(expected, path.win32.extname("C:" + input)); + assertEq(expected, path.win32.extname(input)); + assertEq(expected, path.win32.extname("C:" + input)); }); // On Windows, backslash is a path separator. - assertEqual(path.win32.extname(".\\"), ""); - assertEqual(path.win32.extname("..\\"), ""); - assertEqual(path.win32.extname("file.ext\\"), ".ext"); - assertEqual(path.win32.extname("file.ext\\\\"), ".ext"); - assertEqual(path.win32.extname("file\\"), ""); - assertEqual(path.win32.extname("file\\\\"), ""); - assertEqual(path.win32.extname("file.\\"), "."); - assertEqual(path.win32.extname("file.\\\\"), "."); + assertEq(path.win32.extname(".\\"), ""); + assertEq(path.win32.extname("..\\"), ""); + assertEq(path.win32.extname("file.ext\\"), ".ext"); + assertEq(path.win32.extname("file.ext\\\\"), ".ext"); + assertEq(path.win32.extname("file\\"), ""); + assertEq(path.win32.extname("file\\\\"), ""); + assertEq(path.win32.extname("file.\\"), "."); + assertEq(path.win32.extname("file.\\\\"), "."); }); |
