Skip to content

Commit c8b2f55

Browse files
committed
url: add file port tests to url test fixtures
1 parent 9d868c6 commit c8b2f55

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

test/fixtures/url-setter-tests.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,17 @@ module.exports =
966966
// "port": "12"
967967
// }
968968
// }
969+
{
970+
"comment": "Port numbers in file URLs are ignored",
971+
"href": "file:///example/foo",
972+
"new_value": "example.net:81",
973+
"expected": {
974+
"href": "file://example.net:81/example/foo",
975+
"host": "example.net:81",
976+
"hostname": "example.net:81",
977+
"port": ""
978+
}
979+
}
969980
],
970981
"hostname": [
971982
{
@@ -1300,6 +1311,17 @@ module.exports =
13001311
// "port": "12"
13011312
// }
13021313
// }
1314+
{
1315+
"comment": "Port numbers in file URLs are ignored",
1316+
"href": "file:///example/foo",
1317+
"new_value": "example.net:81",
1318+
"expected": {
1319+
"href": "file://example.net/example/foo",
1320+
"host": "example.net",
1321+
"hostname": "example.net",
1322+
"port": ""
1323+
}
1324+
}
13031325
],
13041326
"port": [
13051327
{

test/fixtures/url-tests.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5996,5 +5996,19 @@ module.exports =
59965996
"pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
59975997
"search": "",
59985998
"hash": ""
5999+
},
6000+
{
6001+
"input": "file://example.net:81/foo",
6002+
"base": "about:blank",
6003+
"href": "file://example.net:81/foo",
6004+
"protocol": "file:",
6005+
"username": "",
6006+
"password": "",
6007+
"host": "example.net:81",
6008+
"hostname": "example.net:81",
6009+
"port": "",
6010+
"pathname": "/foo",
6011+
"search": "",
6012+
"hash": ""
59996013
}
60006014
]

0 commit comments

Comments
 (0)