1 description("Test URLs that have a port number.");
4 // Invalid input should be copied w/ failure.
7 // Default port should be omitted.
10 // Empty ports (just a colon) should also be removed
12 // Code point with a numeric value U+1369 ETHIOPIC DIGIT ONE
13 ["\u1369", ":%E1%8D%A9"],
14 // Code point with a numerical mapping and value U+1D7D6 MATHEMATICAL BOLD DIGIT EIGHT
15 ["\uD835\uDFD6", ":%F0%9D%9F%96"],
18 for (var i
= 0; i
< cases
.length
; ++i
) {
19 shouldBe("canonicalize('http://www.example.com:" + cases
[i
][0] + "/')",
20 "'http://www.example.com" + cases
[i
][1] + "/'");
23 // Unspecified port should mean always keep the port.
24 shouldBe("canonicalize('foobar://www.example.com:80/')",
25 "'foobar://www.example.com:80/'");