Lines Matching refs:expected
9 for (const expected of urlTests) {
11 if (typeof expected === "string")
14 const base = expected.base !== null ? expected.base : undefined;
16 function getKey(expected) {
17 if (expected.protocol) {
18 return expected.protocol.replace(":", "");
20 if (expected.failure) {
21 return expected.input.split(":")[0];
26 subsetTestByKey(getKey(expected), test, function() {
27 if (expected.failure) {
29 new URL(expected.input, base);
34 const url = new URL(expected.input, base);
35 assert_equals(url.href, expected.href, "href")
36 assert_equals(url.protocol, expected.protocol, "protocol")
37 assert_equals(url.username, expected.username, "username")
38 assert_equals(url.password, expected.password, "password")
39 assert_equals(url.host, expected.host, "host")
40 assert_equals(url.hostname, expected.hostname, "hostname")
41 assert_equals(url.port, expected.port, "port")
42 assert_equals(url.pathname, expected.pathname, "pathname")
43 assert_equals(url.search, expected.search, "search")
44 if ("searchParams" in expected) {
46 assert_equals(url.searchParams.toString(), expected.searchParams, "searchParams")
48 assert_equals(url.hash, expected.hash, "hash")
49 }, `Parsing: <${expected.input}> ${base ? "against <" + base + ">" : "without base"}`)