Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add failing tests

  • Loading branch information...
commit 7447fa9932e0751a3604ace221efb5e7534b412a 1 parent 1ba2c32
isaacs authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 test/simple/test-url.js
27 test/simple/test-url.js
View
@@ -274,8 +274,28 @@ var parseTests = {
'search' : '?search=foo',
'query' : 'search=foo',
'hash' : '#bar'
+ },
+ 'http://➡.ws/pageloads' : {
+ 'href' : 'http://➡.ws/pageloads',
+ 'protocol' : 'http:',
+ 'host' : '➡.ws',
+ 'hostname' : '➡.ws',
+ 'pathname' : '/pageloads'
+ },
+ 'http://user:pass@[::1]:8080/path?search=query#hash' : {
+ 'href' : 'http://user:pass@[::1]:8080/path?search=query#hash',
+ 'protocol' : 'http:',
+ 'host' : 'user:pass@[::1]:8080',
+ 'auth' : 'user:pass',
+ 'hostname' : '::1',
+ 'pathname' : '/path',
+ 'search' : '?search=query',
+ 'query' : 'search=query',
+ 'hash' : '#hash'
}
+
};
+
for (var u in parseTests) {
var actual = url.parse(u),
expected = parseTests[u];
@@ -419,6 +439,13 @@ var formatTests = {
'hostname': 'foo',
'protocol': 'http:',
'pathname': '/'
+ },
+ 'http://atslash%3A%2F%40:%2F%40@foo/' : {
+ 'href': 'http://atslash%3A%2F%40:%2F%40@foo/',
+ 'auth': 'atslash%3A/@:/@',
+ 'hostname': 'foo',
+ 'protocol': 'http:',
+ 'pathname': '/'
}
};
for (var u in formatTests) {
Please sign in to comment.
Something went wrong with that request. Please try again.