Portable WHATWG URL parsing and normalization ported from Ada
///|
test {
let url = @url.parse("HTTPS://Example.COM:443/a/../b?q=hello world")
assert_eq(url.href(), "https://example.com/b?q=hello%20world")
assert_eq(url.join("../next").href(), "https://example.com/next")
}///|
test {
let params = @url.SearchParams::parse("a=hello+world&a=second")
assert_eq(params.get_all("a"), ["hello world", "second"])
params.set("a", "one & two")
assert_eq(params.to_string(), "a=one+%26+two")
}type SearchParamstype Urltest {
let url = @url.parse("HTTPS://Example.COM:443/a/../b?q=hello world")
assert_eq(url.href(), "https://example.com/b?q=hello%20world")
let next = @url.parse("../c", base=url)
assert_eq(next.href(), "https://example.com/c")
}fn verify_dns_length(domain : StringView) -> Bool