Skip to content

Commit 1adb08e

Browse files
watildeevanlucas
authored andcommitted
test: synchronize WPT url test data
PR-URL: #12507 Refs: web-platform-tests/wpt#4586 Refs: #11887 Reviewed-By: James M Snell <[email protected]>
1 parent b8d1a45 commit 1adb08e

File tree

2 files changed

+90
-55
lines changed

2 files changed

+90
-55
lines changed

test/fixtures/url-setter-tests.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ module.exports =
3434
"href": "a://example.net",
3535
"new_value": "",
3636
"expected": {
37-
"href": "a://example.net/",
37+
"href": "a://example.net",
3838
"protocol": "a:"
3939
}
4040
},
4141
{
4242
"href": "a://example.net",
4343
"new_value": "b",
4444
"expected": {
45-
"href": "b://example.net/",
45+
"href": "b://example.net",
4646
"protocol": "b:"
4747
}
4848
},
@@ -59,7 +59,7 @@ module.exports =
5959
"href": "a://example.net",
6060
"new_value": "B",
6161
"expected": {
62-
"href": "b://example.net/",
62+
"href": "b://example.net",
6363
"protocol": "b:"
6464
}
6565
},
@@ -68,7 +68,7 @@ module.exports =
6868
"href": "a://example.net",
6969
"new_value": "é",
7070
"expected": {
71-
"href": "a://example.net/",
71+
"href": "a://example.net",
7272
"protocol": "a:"
7373
}
7474
},
@@ -77,7 +77,7 @@ module.exports =
7777
"href": "a://example.net",
7878
"new_value": "0b",
7979
"expected": {
80-
"href": "a://example.net/",
80+
"href": "a://example.net",
8181
"protocol": "a:"
8282
}
8383
},
@@ -86,15 +86,15 @@ module.exports =
8686
"href": "a://example.net",
8787
"new_value": "+b",
8888
"expected": {
89-
"href": "a://example.net/",
89+
"href": "a://example.net",
9090
"protocol": "a:"
9191
}
9292
},
9393
{
9494
"href": "a://example.net",
9595
"new_value": "bC0+-.",
9696
"expected": {
97-
"href": "bc0+-.://example.net/",
97+
"href": "bc0+-.://example.net",
9898
"protocol": "bc0+-.:"
9999
}
100100
},
@@ -103,7 +103,7 @@ module.exports =
103103
"href": "a://example.net",
104104
"new_value": "b,c",
105105
"expected": {
106-
"href": "a://example.net/",
106+
"href": "a://example.net",
107107
"protocol": "a:"
108108
}
109109
},
@@ -112,7 +112,7 @@ module.exports =
112112
"href": "a://example.net",
113113
"new_value": "bé",
114114
"expected": {
115-
"href": "a://example.net/",
115+
"href": "a://example.net",
116116
"protocol": "a:"
117117
}
118118
},
@@ -213,23 +213,31 @@ module.exports =
213213
"href": "ssh://[email protected]",
214214
"new_value": "http",
215215
"expected": {
216-
"href": "ssh://[email protected]/",
216+
"href": "ssh://[email protected]",
217217
"protocol": "ssh:"
218218
}
219219
},
220220
{
221221
"href": "ssh://[email protected]",
222222
"new_value": "gopher",
223223
"expected": {
224-
"href": "ssh://[email protected]/",
224+
"href": "ssh://[email protected]",
225225
"protocol": "ssh:"
226226
}
227227
},
228228
{
229229
"href": "ssh://[email protected]",
230230
"new_value": "file",
231231
"expected": {
232-
"href": "ssh://[email protected]/",
232+
"href": "ssh://[email protected]",
233+
"protocol": "ssh:"
234+
}
235+
},
236+
{
237+
"href": "ssh://example.net",
238+
"new_value": "file",
239+
"expected": {
240+
"href": "ssh://example.net",
233241
"protocol": "ssh:"
234242
}
235243
},
@@ -1585,6 +1593,33 @@ module.exports =
15851593
"href": "http://example.net/%3F",
15861594
"pathname": "/%3F"
15871595
}
1596+
},
1597+
{
1598+
"comment": "# needs to be encoded",
1599+
"href": "http://example.net",
1600+
"new_value": "#",
1601+
"expected": {
1602+
"href": "http://example.net/%23",
1603+
"pathname": "/%23"
1604+
}
1605+
},
1606+
{
1607+
"comment": "? needs to be encoded, non-special scheme",
1608+
"href": "sc://example.net",
1609+
"new_value": "?",
1610+
"expected": {
1611+
"href": "sc://example.net/%3F",
1612+
"pathname": "/%3F"
1613+
}
1614+
},
1615+
{
1616+
"comment": "# needs to be encoded, non-special scheme",
1617+
"href": "sc://example.net",
1618+
"new_value": "#",
1619+
"expected": {
1620+
"href": "sc://example.net/%23",
1621+
"pathname": "/%23"
1622+
}
15881623
}
15891624
],
15901625
"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)