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:
Anne van Kesteren 2023-03-20 20:18:46 +00:00 коммит произвёл moz-wptsync-bot
Родитель c706e046a9
Коммит dd894b2c15
1 изменённых файлов: 42 добавлений и 0 удалений

Просмотреть файл

@ -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})`);
});