test: synchronize WPT url test data

Refs: https://github.com/w3c/web-platform-tests/pull/4586
Refs: https://github.com/nodejs/node/pull/11887
PR-URL: https://github.com/nodejs/node/pull/12058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
This commit is contained in:
Daijiro Wachi 2017-04-03 17:47:46 +09:00
parent f8f46f9917
commit 50bfef66f0
2 changed files with 90 additions and 55 deletions

View File

@ -28,7 +28,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "", "new_value": "",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -36,7 +36,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "b", "new_value": "b",
"expected": { "expected": {
"href": "b://example.net/", "href": "b://example.net",
"protocol": "b:" "protocol": "b:"
} }
}, },
@ -45,7 +45,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "B", "new_value": "B",
"expected": { "expected": {
"href": "b://example.net/", "href": "b://example.net",
"protocol": "b:" "protocol": "b:"
} }
}, },
@ -54,7 +54,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "é", "new_value": "é",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -63,7 +63,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "0b", "new_value": "0b",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -72,7 +72,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "+b", "new_value": "+b",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -80,7 +80,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "bC0+-.", "new_value": "bC0+-.",
"expected": { "expected": {
"href": "bc0+-.://example.net/", "href": "bc0+-.://example.net",
"protocol": "bc0+-.:" "protocol": "bc0+-.:"
} }
}, },
@ -89,7 +89,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "b,c", "new_value": "b,c",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -98,7 +98,7 @@
"href": "a://example.net", "href": "a://example.net",
"new_value": "bé", "new_value": "bé",
"expected": { "expected": {
"href": "a://example.net/", "href": "a://example.net",
"protocol": "a:" "protocol": "a:"
} }
}, },
@ -190,7 +190,7 @@
"href": "ssh://me@example.net", "href": "ssh://me@example.net",
"new_value": "http", "new_value": "http",
"expected": { "expected": {
"href": "ssh://me@example.net/", "href": "ssh://me@example.net",
"protocol": "ssh:" "protocol": "ssh:"
} }
}, },
@ -198,7 +198,7 @@
"href": "ssh://me@example.net", "href": "ssh://me@example.net",
"new_value": "gopher", "new_value": "gopher",
"expected": { "expected": {
"href": "ssh://me@example.net/", "href": "ssh://me@example.net",
"protocol": "ssh:" "protocol": "ssh:"
} }
}, },
@ -206,7 +206,15 @@
"href": "ssh://me@example.net", "href": "ssh://me@example.net",
"new_value": "file", "new_value": "file",
"expected": { "expected": {
"href": "ssh://me@example.net/", "href": "ssh://me@example.net",
"protocol": "ssh:"
}
},
{
"href": "ssh://example.net",
"new_value": "file",
"expected": {
"href": "ssh://example.net",
"protocol": "ssh:" "protocol": "ssh:"
} }
}, },
@ -1072,6 +1080,33 @@
"href": "http://example.net/%3F", "href": "http://example.net/%3F",
"pathname": "/%3F" "pathname": "/%3F"
} }
},
{
"comment": "# needs to be encoded",
"href": "http://example.net",
"new_value": "#",
"expected": {
"href": "http://example.net/%23",
"pathname": "/%23"
}
},
{
"comment": "? needs to be encoded, non-special scheme",
"href": "sc://example.net",
"new_value": "?",
"expected": {
"href": "sc://example.net/%3F",
"pathname": "/%3F"
}
},
{
"comment": "# needs to be encoded, non-special scheme",
"href": "sc://example.net",
"new_value": "#",
"expected": {
"href": "sc://example.net/%23",
"pathname": "/%23"
}
} }
], ],
"search": [ "search": [

View File

@ -571,21 +571,21 @@ module.exports =
"search": "", "search": "",
"hash": "" "hash": ""
}, },
// { {
// "input": "foo://", "input": "foo://",
// "base": "http://example.org/foo/bar", "base": "http://example.org/foo/bar",
// "href": "foo://", "href": "foo://",
// "origin": "null", "origin": "null",
// "protocol": "foo:", "protocol": "foo:",
// "username": "", "username": "",
// "password": "", "password": "",
// "host": "", "host": "",
// "hostname": "", "hostname": "",
// "port": "", "port": "",
// "pathname": "", "pathname": "",
// "search": "", "search": "",
// "hash": "" "hash": ""
// }, },
{ {
"input": "http://a:b@c:29/d", "input": "http://a:b@c:29/d",
"base": "http://example.org/foo/bar", "base": "http://example.org/foo/bar",
@ -5338,34 +5338,34 @@ module.exports =
"search": "", "search": "",
"hash": "" "hash": ""
}, },
// { {
// "input": "////", "input": "////",
// "base": "sc://x/", "base": "sc://x/",
// "href": "sc:////", "href": "sc:////",
// "protocol": "sc:", "protocol": "sc:",
// "username": "", "username": "",
// "password": "", "password": "",
// "host": "", "host": "",
// "hostname": "", "hostname": "",
// "port": "", "port": "",
// "pathname": "//", "pathname": "//",
// "search": "", "search": "",
// "hash": "" "hash": ""
// }, },
// { {
// "input": "////x/", "input": "////x/",
// "base": "sc://x/", "base": "sc://x/",
// "href": "sc:////x/", "href": "sc:////x/",
// "protocol": "sc:", "protocol": "sc:",
// "username": "", "username": "",
// "password": "", "password": "",
// "host": "", "host": "",
// "hostname": "", "hostname": "",
// "port": "", "port": "",
// "pathname": "//x/", "pathname": "//x/",
// "search": "", "search": "",
// "hash": "" "hash": ""
// }, },
{ {
"input": "tftp://foobar.com/someconfig;mode=netascii", "input": "tftp://foobar.com/someconfig;mode=netascii",
"base": "about:blank", "base": "about:blank",