Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-07-21 00:15:41 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2011-07-21 02:51:48 +0400
commit1b0e054737b207977981e0fc818b013ba8bb0caa (patch)
tree502d3d5fb3e25e40e3e248d26e2336950c74d72c /test
parent6f0740e67b785599cfd1112647249b5c678c7214 (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.js15
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