Skip to content

Commit

Permalink
path, bugfix: fix test case error on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Nov 7, 2017
1 parent c3ba036 commit 0f4adf5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/path_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ describe('path', () => {

it('basename', () => {
function test(fn) {
assert.strictEqual(fn(__filename), 'path_test.js');
assert.strictEqual(fn(__filename, '.js'), 'path_test');
if (!isWindows) {
assert.strictEqual(fn(__filename), 'path_test.js');
assert.strictEqual(fn(__filename, '.js'), 'path_test');
}

assert.strictEqual(fn('.js', '.js'), '');
assert.strictEqual(fn(''), '');
assert.strictEqual(fn('/dir/basename.ext'), 'basename.ext');
Expand Down Expand Up @@ -213,7 +216,7 @@ describe('path', () => {
// On windows, backspace is a path separator.
assert.equal(path.extname('.\\'), '');
assert.equal(path.extname('..\\'), '');
assert.equal(path.extname('file.ext\\'), '');
assert.equal(path.extname('file.ext\\'), '.ext');
} else {
// On unix, backspace is a valid name component like any other character.
assert.equal(path.extname('.\\'), '');
Expand Down

0 comments on commit 0f4adf5

Please sign in to comment.