Browse Source

test: remove duplicate path tests

The TypeError checks are already done later on in the test file
for all path functions.

PR-URL: https://github.com/nodejs/node/pull/6590
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
v6.x
Brian White 9 years ago
committed by Rod Vagg
parent
commit
1469b98fa1
  1. 25
      test/parallel/test-path.js

25
test/parallel/test-path.js

@ -43,11 +43,6 @@ assert.equal(path.posix.basename('basename.ext'), 'basename.ext');
assert.equal(path.posix.basename('basename.ext\\'), 'basename.ext\\'); assert.equal(path.posix.basename('basename.ext\\'), 'basename.ext\\');
assert.equal(path.posix.basename('basename.ext\\\\'), 'basename.ext\\\\'); assert.equal(path.posix.basename('basename.ext\\\\'), 'basename.ext\\\\');
assert.equal(path.posix.basename('foo'), 'foo'); assert.equal(path.posix.basename('foo'), 'foo');
assert.throws(path.posix.basename.bind(null, null), TypeError);
assert.throws(path.posix.basename.bind(null, true), TypeError);
assert.throws(path.posix.basename.bind(null, 1), TypeError);
assert.throws(path.posix.basename.bind(null), TypeError);
assert.throws(path.posix.basename.bind(null, {}), TypeError);
// POSIX filenames may include control characters // POSIX filenames may include control characters
// c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html // c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html
@ -67,11 +62,6 @@ assert.equal(path.posix.dirname(''), '.');
assert.equal(path.posix.dirname('/'), '/'); assert.equal(path.posix.dirname('/'), '/');
assert.equal(path.posix.dirname('////'), '/'); assert.equal(path.posix.dirname('////'), '/');
assert.equal(path.posix.dirname('foo'), '.'); assert.equal(path.posix.dirname('foo'), '.');
assert.throws(path.posix.dirname.bind(null, null), TypeError);
assert.throws(path.posix.dirname.bind(null, true), TypeError);
assert.throws(path.posix.dirname.bind(null, 1), TypeError);
assert.throws(path.posix.dirname.bind(null), TypeError);
assert.throws(path.posix.dirname.bind(null, {}), TypeError);
assert.equal(path.win32.dirname('c:\\'), 'c:\\'); assert.equal(path.win32.dirname('c:\\'), 'c:\\');
assert.equal(path.win32.dirname('c:\\foo'), 'c:\\'); assert.equal(path.win32.dirname('c:\\foo'), 'c:\\');
@ -107,11 +97,6 @@ assert.equal(path.win32.dirname(''), '.');
assert.equal(path.win32.dirname('/'), '/'); assert.equal(path.win32.dirname('/'), '/');
assert.equal(path.win32.dirname('////'), '/'); assert.equal(path.win32.dirname('////'), '/');
assert.equal(path.win32.dirname('foo'), '.'); assert.equal(path.win32.dirname('foo'), '.');
assert.throws(path.win32.dirname.bind(null, null), TypeError);
assert.throws(path.win32.dirname.bind(null, true), TypeError);
assert.throws(path.win32.dirname.bind(null, 1), TypeError);
assert.throws(path.win32.dirname.bind(null), TypeError);
assert.throws(path.win32.dirname.bind(null, {}), TypeError);
// path.extname tests // path.extname tests
@ -190,11 +175,6 @@ assert.equal(path.win32.extname('file\\'), '');
assert.equal(path.win32.extname('file\\\\'), ''); assert.equal(path.win32.extname('file\\\\'), '');
assert.equal(path.win32.extname('file.\\'), '.'); assert.equal(path.win32.extname('file.\\'), '.');
assert.equal(path.win32.extname('file.\\\\'), '.'); assert.equal(path.win32.extname('file.\\\\'), '.');
assert.throws(path.win32.extname.bind(null, null), TypeError);
assert.throws(path.win32.extname.bind(null, true), TypeError);
assert.throws(path.win32.extname.bind(null, 1), TypeError);
assert.throws(path.win32.extname.bind(null), TypeError);
assert.throws(path.win32.extname.bind(null, {}), TypeError);
// On *nix, backslash is a valid name component like any other character. // On *nix, backslash is a valid name component like any other character.
assert.equal(path.posix.extname('.\\'), ''); assert.equal(path.posix.extname('.\\'), '');
@ -205,11 +185,6 @@ assert.equal(path.posix.extname('file\\'), '');
assert.equal(path.posix.extname('file\\\\'), ''); assert.equal(path.posix.extname('file\\\\'), '');
assert.equal(path.posix.extname('file.\\'), '.\\'); assert.equal(path.posix.extname('file.\\'), '.\\');
assert.equal(path.posix.extname('file.\\\\'), '.\\\\'); assert.equal(path.posix.extname('file.\\\\'), '.\\\\');
assert.throws(path.posix.extname.bind(null, null), TypeError);
assert.throws(path.posix.extname.bind(null, true), TypeError);
assert.throws(path.posix.extname.bind(null, 1), TypeError);
assert.throws(path.posix.extname.bind(null), TypeError);
assert.throws(path.posix.extname.bind(null, {}), TypeError);
// path.join tests // path.join tests

Loading…
Cancel
Save