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