diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-07-21 00:15:41 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-07-21 02:51:48 +0400 |
commit | 1b0e054737b207977981e0fc818b013ba8bb0caa (patch) | |
tree | 502d3d5fb3e25e40e3e248d26e2336950c74d72c /test | |
parent | 6f0740e67b785599cfd1112647249b5c678c7214 (diff) |
url: throw descriptive error if url argument to parse() is not a string
Fixes #568.
Diffstat (limited to 'test')
-rw-r--r-- | test/simple/test-url.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/simple/test-url.js b/test/simple/test-url.js index fdf8bde5962..c6c47292e05 100644 --- a/test/simple/test-url.js +++ b/test/simple/test-url.js @@ -545,6 +545,21 @@ relativeTests.forEach(function(relativeTest) { }); +// https://github.com/joyent/node/issues/568 +[ + undefined, + null, + true, + false, + 0.0, + 0, + [], + {} +].forEach(function(val) { + assert.throws(function() { url.parse(val); }, TypeError); +}); + + // // Tests below taken from Chiron // http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js |