From e36edfdb3fd4709358a5f499f13cfe3d53c2b4f7 Mon Sep 17 00:00:00 2001 From: Vincent LE GOFF Date: Wed, 6 Mar 2019 22:39:50 +0100 Subject: Testing refactor (denoland/deno_std#240) Original: https://github.com/denoland/deno_std/commit/e1d5c00279132aa639030c6c6d9b4e308bd4775e --- fs/path/extname_test.ts | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'fs/path/extname_test.ts') 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.\\\\"), "."); }); -- cgit v1.2.3