Skip to content

Commit 50bfef6

Browse files
committed
test: synchronize WPT url test data
Refs: web-platform-tests/wpt#4586 Refs: #11887 PR-URL: #12058 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
1 parent f8f46f9 commit 50bfef6

File tree

2 files changed

+90
-55
lines changed

2 files changed

+90
-55
lines changed

test/fixtures/url-setter-tests.json

+47-12
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
"href": "a://example.net",
2929
"new_value": "",
3030
"expected": {
31-
"href": "a://example.net/",
31+
"href": "a://example.net",
3232
"protocol": "a:"
3333
}
3434
},
3535
{
3636
"href": "a://example.net",
3737
"new_value": "b",
3838
"expected": {
39-
"href": "b://example.net/",
39+
"href": "b://example.net",
4040
"protocol": "b:"
4141
}
4242
},
@@ -45,7 +45,7 @@
4545
"href": "a://example.net",
4646
"new_value": "B",
4747
"expected": {
48-
"href": "b://example.net/",
48+
"href": "b://example.net",
4949
"protocol": "b:"
5050
}
5151
},
@@ -54,7 +54,7 @@
5454
"href": "a://example.net",
5555
"new_value": "é",
5656
"expected": {
57-
"href": "a://example.net/",
57+
"href": "a://example.net",
5858
"protocol": "a:"
5959
}
6060
},
@@ -63,7 +63,7 @@
6363
"href": "a://example.net",
6464
"new_value": "0b",
6565
"expected": {
66-
"href": "a://example.net/",
66+
"href": "a://example.net",
6767
"protocol": "a:"
6868
}
6969
},
@@ -72,15 +72,15 @@
7272
"href": "a://example.net",
7373
"new_value": "+b",
7474
"expected": {
75-
"href": "a://example.net/",
75+
"href": "a://example.net",
7676
"protocol": "a:"
7777
}
7878
},
7979
{
8080
"href": "a://example.net",
8181
"new_value": "bC0+-.",
8282
"expected": {
83-
"href": "bc0+-.://example.net/",
83+
"href": "bc0+-.://example.net",
8484
"protocol": "bc0+-.:"
8585
}
8686
},
@@ -89,7 +89,7 @@
8989
"href": "a://example.net",
9090
"new_value": "b,c",
9191
"expected": {
92-
"href": "a://example.net/",
92+
"href": "a://example.net",
9393
"protocol": "a:"
9494
}
9595
},
@@ -98,7 +98,7 @@
9898
"href": "a://example.net",
9999
"new_value": "",
100100
"expected": {
101-
"href": "a://example.net/",
101+
"href": "a://example.net",
102102
"protocol": "a:"
103103
}
104104
},
@@ -190,23 +190,31 @@
190190
"href": "ssh://me@example.net",
191191
"new_value": "http",
192192
"expected": {
193-
"href": "ssh://me@example.net/",
193+
"href": "ssh://me@example.net",
194194
"protocol": "ssh:"
195195
}
196196
},
197197
{
198198
"href": "ssh://me@example.net",
199199
"new_value": "gopher",
200200
"expected": {
201-
"href": "ssh://me@example.net/",
201+
"href": "ssh://me@example.net",
202202
"protocol": "ssh:"
203203
}
204204
},
205205
{
206206
"href": "ssh://me@example.net",
207207
"new_value": "file",
208208
"expected": {
209-
"href": "ssh://me@example.net/",
209+
"href": "ssh://me@example.net",
210+
"protocol": "ssh:"
211+
}
212+
},
213+
{
214+
"href": "ssh://example.net",
215+
"new_value": "file",
216+
"expected": {
217+
"href": "ssh://example.net",
210218
"protocol": "ssh:"
211219
}
212220
},
@@ -1072,6 +1080,33 @@
10721080
"href": "http://example.net/%3F",
10731081
"pathname": "/%3F"
10741082
}
1083+
},
1084+
{
1085+
"comment": "# needs to be encoded",
1086+
"href": "http://example.net",
1087+
"new_value": "#",
1088+
"expected": {
1089+
"href": "http://example.net/%23",
1090+
"pathname": "/%23"
1091+
}
1092+
},
1093+
{
1094+
"comment": "? needs to be encoded, non-special scheme",
1095+
"href": "sc://example.net",
1096+
"new_value": "?",
1097+
"expected": {
1098+
"href": "sc://example.net/%3F",
1099+
"pathname": "/%3F"
1100+
}
1101+
},
1102+
{
1103+
"comment": "# needs to be encoded, non-special scheme",
1104+
"href": "sc://example.net",
1105+
"new_value": "#",
1106+
"expected": {
1107+
"href": "sc://example.net/%23",
1108+
"pathname": "/%23"
1109+
}
10751110
}
10761111
],
10771112
"search": [

test/fixtures/url-tests.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -571,21 +571,21 @@ module.exports =
571571
"search": "",
572572
"hash": ""
573573
},
574-
// {
575-
// "input": "foo://",
576-
// "base": "http://example.org/foo/bar",
577-
// "href": "foo://",
578-
// "origin": "null",
579-
// "protocol": "foo:",
580-
// "username": "",
581-
// "password": "",
582-
// "host": "",
583-
// "hostname": "",
584-
// "port": "",
585-
// "pathname": "",
586-
// "search": "",
587-
// "hash": ""
588-
// },
574+
{
575+
"input": "foo://",
576+
"base": "http://example.org/foo/bar",
577+
"href": "foo://",
578+
"origin": "null",
579+
"protocol": "foo:",
580+
"username": "",
581+
"password": "",
582+
"host": "",
583+
"hostname": "",
584+
"port": "",
585+
"pathname": "",
586+
"search": "",
587+
"hash": ""
588+
},
589589
{
590590
"input": "http://a:b@c:29/d",
591591
"base": "http://example.org/foo/bar",
@@ -5338,34 +5338,34 @@ module.exports =
53385338
"search": "",
53395339
"hash": ""
53405340
},
5341-
// {
5342-
// "input": "////",
5343-
// "base": "sc://x/",
5344-
// "href": "sc:////",
5345-
// "protocol": "sc:",
5346-
// "username": "",
5347-
// "password": "",
5348-
// "host": "",
5349-
// "hostname": "",
5350-
// "port": "",
5351-
// "pathname": "//",
5352-
// "search": "",
5353-
// "hash": ""
5354-
// },
5355-
// {
5356-
// "input": "////x/",
5357-
// "base": "sc://x/",
5358-
// "href": "sc:////x/",
5359-
// "protocol": "sc:",
5360-
// "username": "",
5361-
// "password": "",
5362-
// "host": "",
5363-
// "hostname": "",
5364-
// "port": "",
5365-
// "pathname": "//x/",
5366-
// "search": "",
5367-
// "hash": ""
5368-
// },
5341+
{
5342+
"input": "////",
5343+
"base": "sc://x/",
5344+
"href": "sc:////",
5345+
"protocol": "sc:",
5346+
"username": "",
5347+
"password": "",
5348+
"host": "",
5349+
"hostname": "",
5350+
"port": "",
5351+
"pathname": "//",
5352+
"search": "",
5353+
"hash": ""
5354+
},
5355+
{
5356+
"input": "////x/",
5357+
"base": "sc://x/",
5358+
"href": "sc:////x/",
5359+
"protocol": "sc:",
5360+
"username": "",
5361+
"password": "",
5362+
"host": "",
5363+
"hostname": "",
5364+
"port": "",
5365+
"pathname": "//x/",
5366+
"search": "",
5367+
"hash": ""
5368+
},
53695369
{
53705370
"input": "tftp://foobar.com/someconfig;mode=netascii",
53715371
"base": "about:blank",

0 commit comments

Comments
 (0)