зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1823131 [wpt PR 39069] - URL: URL.canParse(), a=testonly
Automatic update from web-platform-tests URL: URL.canParse() For https://github.com/whatwg/url/pull/763. -- wpt-commits: 7c5c3cc125979b4768d414471e6ab655b473aae8 wpt-pr: 39069
This commit is contained in:
Родитель
c706e046a9
Коммит
dd894b2c15
|
@ -0,0 +1,42 @@
|
|||
// This intentionally does not use resources/urltestdata.json to preserve resources.
|
||||
[
|
||||
{
|
||||
"url": undefined,
|
||||
"base": undefined,
|
||||
"expected": false
|
||||
},
|
||||
{
|
||||
"url": "a:b",
|
||||
"base": undefined,
|
||||
"expected": true
|
||||
},
|
||||
{
|
||||
"url": undefined,
|
||||
"base": "a:b",
|
||||
"expected": false
|
||||
},
|
||||
{
|
||||
"url": "a:/b",
|
||||
"base": undefined,
|
||||
"expected": true
|
||||
},
|
||||
{
|
||||
"url": undefined,
|
||||
"base": "a:/b",
|
||||
"expected": true
|
||||
},
|
||||
{
|
||||
"url": "https://test:test",
|
||||
"base": undefined,
|
||||
"expected": false
|
||||
},
|
||||
{
|
||||
"url": "a",
|
||||
"base": "https://b/",
|
||||
"expected": true
|
||||
}
|
||||
].forEach(({ url, base, expected }) => {
|
||||
test(() => {
|
||||
assert_equals(URL.canParse(url, base), expected);
|
||||
}, `URL.canParse(${url}, ${base})`);
|
||||
});
|
Загрузка…
Ссылка в новой задаче