summaryrefslogtreecommitdiff
path: root/test/parallel/test-path-parse-format.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2015-03-13 22:21:47 -0400
committercjihrig <cjihrig@gmail.com>2015-03-16 12:49:21 -0400
commiteb995d682201018b2a47c44e921848cfa31486a2 (patch)
treeff61650847ff14524f8d88f7b2c40f21da2e9f3a /test/parallel/test-path-parse-format.js
parenta28945b12876fea74091ba426eb636f8101262c9 (diff)
downloadandroid-node-v8-eb995d682201018b2a47c44e921848cfa31486a2.tar.gz
android-node-v8-eb995d682201018b2a47c44e921848cfa31486a2.tar.bz2
android-node-v8-eb995d682201018b2a47c44e921848cfa31486a2.zip
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>
Diffstat (limited to 'test/parallel/test-path-parse-format.js')
-rw-r--r--test/parallel/test-path-parse-format.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js
index a3120891fe..d31dc99572 100644
--- a/test/parallel/test-path-parse-format.js
+++ b/test/parallel/test-path-parse-format.js
@@ -30,11 +30,11 @@ var unixPaths = [
];
var errors = [
- {method: 'parse', input: [null], message: /Parameter 'pathString' must be a string, not/},
- {method: 'parse', input: [{}], message: /Parameter 'pathString' must be a string, not object/},
- {method: 'parse', input: [true], message: /Parameter 'pathString' must be a string, not boolean/},
- {method: 'parse', input: [1], message: /Parameter 'pathString' must be a string, not number/},
- {method: 'parse', input: [], message: /Parameter 'pathString' must be a string, not undefined/},
+ {method: 'parse', input: [null], message: /Path must be a string. Received null/},
+ {method: 'parse', input: [{}], message: /Path must be a string. Received {}/},
+ {method: 'parse', input: [true], message: /Path must be a string. Received true/},
+ {method: 'parse', input: [1], message: /Path must be a string. Received 1/},
+ {method: 'parse', input: [], message: /Path must be a string. Received undefined/},
// {method: 'parse', input: [''], message: /Invalid path/}, // omitted because it's hard to trigger!
{method: 'format', input: [null], message: /Parameter 'pathObject' must be an object, not/},
{method: 'format', input: [''], message: /Parameter 'pathObject' must be an object, not string/},