Brian White
27549f64ce
test: add more path.basename() tests
...
PR-URL: https://github.com/nodejs/node/pull/6590
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2016-05-18 02:12:47 -04:00
Brian White
7d404122d4
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 >
2016-05-18 02:12:42 -04:00
Brian White
dfaa9c9055
path: fix basename() regressions
...
This commit fixes a regression in basename() for the case when a
supplied extension name completely matches the resulting basename.
Fixes: https://github.com/nodejs/node/issues/6587
PR-URL: https://github.com/nodejs/node/pull/6590
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2016-05-18 02:12:28 -04:00
Rich Trott
a7335bd1f0
test,benchmark: use deepStrictEqual()
...
In preparation for a lint rule that will enforce
assert.deepStrictEqual() over assert.deepEqual(), change tests and
benchmarks accordingly. For tests and benchmarks that are testing or
benchmarking assert.deepEqual() itself, apply a comment to ignore the
upcoming rule.
PR-URL: https://github.com/nodejs/node/pull/6213
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2016-04-22 14:38:09 -07:00
Rich Trott
31600735f4
lib,test,tools: alignment on variable assignments
...
Correct alignment on variable assignments that span multiple lines in
preparation for lint rule to enforce such alignment.
PR-URL: https://github.com/nodejs/node/pull/6242
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-04-18 17:19:11 -07:00
Mike Kaufman
1384de29f7
path: fixing a test that breaks on some machines.
...
A win32-only test was verifying that path.win32._makeLong('C:')
would return the current working directory. This would only work if
current working directory was also on the C: device. Fix is to grab
the device letter for current working directory, and pass that to
_makeLong().
PR-URL: https://github.com/nodejs/node/pull/6067
Reviewed-By: Trott - Rich Trott <rtrott@gmail.com >
Reviewed-By: Joao Reis <reis@janeasystems.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
2016-04-08 16:43:07 -07:00
Brian White
3072546feb
path: fix win32.isAbsolute() inconsistency
...
This commit fixes an inconsistency in absolute path checking compared
to the absolute path detection used by the other path.win32 functions.
Fixes: https://github.com/nodejs/node/issues/6027
PR-URL: https://github.com/nodejs/node/pull/6028
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-04-04 14:45:22 -07:00
Brian White
08085c49b6
path: assert inputs are strings
...
This commit makes input type checking consistent across all path
functions.
PR-URL: https://github.com/nodejs/node/pull/5348
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-03-17 23:20:12 -04:00
Evan Lucas
3d3b45ae95
path: fix normalize for absolutes
...
Fixes a regression introduced by
b212be08f6 .
path.normalize(''/a/b/c/../../../x/y/z'') should return '/x/y/z'.
Fixes: https://github.com/nodejs/node/issues/5585
PR-URL: https://github.com/nodejs/node/pull/5589
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-03-07 14:48:49 -06:00
Owen Smith
f296a7f16f
path: fix path.relative() for prefixes at root
...
Fixes #5485
PR-URL: https://github.com/nodejs/node/pull/5490
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-02-29 20:10:04 +01:00
Owen Smith
7fc6645982
test: add test-cases for posix path.relative()
...
adds posix test cases for paths similar to those that caused #5447
PR-URL: https://github.com/nodejs/node/pull/5456
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-27 17:31:03 +01:00
Owen Smith
e326950498
path: fix win32 relative() for UNC paths
...
win32 normalize() will output a trailing '\' for some UNC paths. trim
them before processing
Change by @mscdex
Add basic UNC path tests to win32 relative()
PR-URL: https://github.com/nodejs/node/pull/5456
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-27 17:30:44 +01:00
Owen Smith
b33879d9e2
path: fix win32 relative() when "to" is a prefix
...
when the basename of "to" was a prefix of the basename of "from" win32
relative() would miss including it in the result
Fixes: https://github.com/nodejs/node/issues/5447
PR-URL: https://github.com/nodejs/node/pull/5456
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-27 17:29:29 +01:00
Brian White
3a331b66f8
path: fix verbose relative() output
...
Fixes: https://github.com/nodejs/node/issues/5383
PR-URL: https://github.com/nodejs/node/pull/5389
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2016-02-27 14:42:33 +01:00
Rich Trott
32f6098eef
src,test,tools: modify for more stringent linting
...
ESLint 2.1.0 is coming. Some lint rules have been tightened.
PR-URL: https://github.com/nodejs/node/pull/5214
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2016-02-18 10:11:26 -08:00
Brian White
9209bf6d43
path: fix input type checking regression
...
Before b212be08f6 , input types were not checked in some path functions
and the inputs were passed directly to `regexp.exec()` which
implicitly converts its argument to a string.
This commit both removes the type checking added in b212be08f6 and
adds string coercion for those functions.
PR-URL: https://github.com/nodejs/node/pull/5244
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2016-02-17 14:18:43 -05:00
Brian White
5a54e4554a
test: improve path tests
...
This commit adds new tests, executes tests for other platforms
instead of limiting platform-specific tests to those platforms,
and fixes a few style/formatting inconsistencies.
PR-URL: https://github.com/nodejs/node/pull/5123
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-09 20:35:41 -08:00
Rich Trott
352173b3bb
test: fix redeclared test-path vars
...
PR-URL: https://github.com/nodejs/node/pull/4991
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-02 08:51:54 -08:00
Sakthipriyan Vairamani
d5ab92bcc1
test: use common.isWindows consistently
...
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.
PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-07-31 00:29:36 +05:30
Roman Reiss
f29762f4dd
test: enable linting for tests
...
Enable linting for the test directory. A number of changes was made so
all tests conform the current rules used by lib and src directories. The
only exception for tests is that unreachable (dead) code is allowed.
test-fs-non-number-arguments-throw had to be excluded from the changes
because of a weird issue on Windows CI.
PR-URL: https://github.com/nodejs/io.js/pull/1721
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-05-19 21:21:27 +02:00
cjihrig
8de78e470d
path: reduce type checking on some methods
...
a465840313 added strict type
checking for the methods in the path module. However, dirname(),
basename(), and extname() actually had some undocumented uses
in the wild. This commit loosens the type checking on those
methods.
Fixes: https://github.com/iojs/io.js/issues/1215
PR-URL: https://github.com/iojs/io.js/pull/1216
Reviewed-By: Rod Vagg <rod@vagg.org >
2015-03-19 21:11:12 -04:00
cjihrig
eb995d6822
path: add type checking for path inputs
...
This commit adds type checking of path inputs to exported methods
in the path module. The exception is _makeLong(), which seems to
explicitly support any data type.
Fixes: https://github.com/iojs/io.js/issues/1139
PR-URL: https://github.com/iojs/io.js/pull/1153
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com >
2015-03-16 12:49:21 -04:00
isaacs
3e1b1dd4a9
Remove excessive copyright/license boilerplate
...
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Fedor Indutny
0e19476595
test: split test in parallel/sequential
...
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
PR-URL: https://github.com/iojs/io.js/pull/172
Fix : iojs/io.js#139
2014-12-17 20:45:02 +07:00