Skip to content

Commit

Permalink
Merge a68ff81 into f282e9d
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Mar 22, 2017
2 parents f282e9d + a68ff81 commit 8095a54
Show file tree
Hide file tree
Showing 2 changed files with 253 additions and 0 deletions.
27 changes: 27 additions & 0 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,33 @@
"href": "sc://example.net/%23",
"pathname": "/%23"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file://monkey/",
"new_value": "\\\\",
"expected": {
"href": "file://monkey/",
"pathname": "/"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file:///unicorn",
"new_value": "//\\/",
"expected": {
"href": "file:///",
"pathname": "/"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file:///unicorn",
"new_value": "//monkey/..//",
"expected": {
"href": "file:///",
"pathname": "/"
}
}
],
"search": [
Expand Down
226 changes: 226 additions & 0 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5137,6 +5137,232 @@
"search": "?test",
"hash": "#x"
},
"# File URLs and many (back)slashes",
{
"input": "file:\\\\//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\?fox",
"base": "about:blank",
"href": "file:///?fox",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "?fox",
"hash": ""
},
{
"input": "file:\\\\\\\\#guppy",
"base": "about:blank",
"href": "file:///#guppy",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": "#guppy"
},
{
"input": "file://spider///",
"base": "about:blank",
"href": "file://spider/",
"protocol": "file:",
"username": "",
"password": "",
"host": "spider",
"hostname": "spider",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:\\\\localhost//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:///localhost//cat",
"base": "about:blank",
"href": "file:///localhost//cat",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/localhost//cat",
"search": "",
"hash": ""
},
{
"input": "file://\\/localhost//cat",
"base": "about:blank",
"href": "file:///localhost//cat",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/localhost//cat",
"search": "",
"hash": ""
},
{
"input": "file://localhost//a//../..//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "/////mouse",
"base": "file:///elephant",
"href": "file:///mouse",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/mouse",
"search": "",
"hash": ""
},
{
"input": "\\//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "\\/localhost//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "//localhost//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "/..//localhost//pig",
"base": "file://lion/",
"href": "file://lion/localhost//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "lion",
"hostname": "lion",
"port": "",
"pathname": "/localhost//pig",
"search": "",
"hash": ""
},
"# File URLs with non-empty hosts",
{
"input": "/rooibos",
"base": "file://tea/",
"href": "file://tea/rooibos",
"protocol": "file:",
"username": "",
"password": "",
"host": "tea",
"hostname": "tea",
"port": "",
"pathname": "/rooibos",
"search": "",
"hash": ""
},
{
"input": "/?chai",
"base": "file://tea/",
"href": "file://tea/?chai",
"protocol": "file:",
"username": "",
"password": "",
"host": "tea",
"hostname": "tea",
"port": "",
"pathname": "/",
"search": "?chai",
"hash": ""
},
"# Windows drive letter quirk with not empty host",
{
"input": "file://example.net/C:/",
Expand Down

0 comments on commit 8095a54

Please sign in to comment.