<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type='text/xsl' href='urldecomp.xslt' ?>
<tests>
  <test>
    <uri>http://example.org/foo/bar;param?query#frag</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/foo/bar;param</pathname>
      <search>?query</search>
      <hash>#frag</hash>
    </expected>
  </test>
  <test>
    <uri>&#32;http://example.org</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>leading whitespace</comment>
  </test>
  <test>
    <uri>http://example.org/a&#32;b</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a b</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>path contains whitespace</comment>
  </test>
  <test>
    <uri>http://example.org/a%20b</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a%20b</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>path contains escaped whitespace</comment>
  </test>
  <test>
    <uri>http://example.org/a%</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a%</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>path contains single %</comment>
  </test>
  <test>
    <uri>http://example.org&#32;</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>trailing whitespace</comment>
  </test>
  <test>
    <uri>http://example.org/"%&lt;>\^`{|}</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/"%&lt;>\^`{|}</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>non-path characters in path</comment>
  </test>
  <test>
    <uri>http://example.org/a-umlaut-ä</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a-umlaut-ä</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>non-ASCII character in path</comment>
  </test>
  <test>
    <uri>http://example.org/a-umlaut-%C3%A4</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a-umlaut-%C3%A4</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>percent-encoded non-ASCII character in path</comment>
  </test>
  <test>
    <uri>http://example.org/a-umlaut-%c3%a4</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a-umlaut-%c3%a4</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>percent-encoded non-ASCII character in path (is the case of percent encoded sequences preserved?)</comment>
  </test>
  <test>
    <uri>http://example.org/a#b#c</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a</pathname>
      <search></search>
      <hash>#b#c</hash>
    </expected>
    <comment>multiple hash characters</comment>
  </test>
  <test>
    <uri>http://example.org/a#b c</uri>
    <expected>
      <protocol>http:</protocol>
      <host>example.org</host>
      <hostname>example.org</hostname>
      <port></port>
      <pathname>/a</pathname>
      <search></search>
      <hash>#b c</hash>
    </expected>
    <comment>white space in fragment</comment>
  </test>
  <test>
    <uri>http://a-umlaut-ä.org/</uri>
    <expected>
      <protocol>http:</protocol>
      <host>a-umlaut-ä.org</host>
      <hostname>a-umlaut-ä.org</hostname>
      <port></port>
      <pathname>/</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>non-ASCII character in host name</comment>
  </test>
  <test>
    <uri>http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/</uri>
    <expected>
      <protocol>http:</protocol>
      <host>[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]</host>
      <hostname>[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]</hostname>
      <port></port>
      <pathname>/</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>IPv6 address</comment>
  </test>
  <test>
    <uri>http://a[b].example.org/</uri>
    <expected>
      <protocol></protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname></pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>does not parse according to WEBADDRESSES</comment>
  </test>
  <test>
    <uri>data:,A%20brief%20note%25foo#bar</uri>
    <expected>
      <protocol>data:</protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname>/,A%20brief%20note%25foo</pathname>
      <search></search>
      <hash>#bar</hash>
    </expected>
    <comment>data URI with fragment</comment>
  </test>
  <test>
    <uri>ical://example.com/apple-made-this-up</uri>
    <expected>
      <protocol>ical:</protocol>
      <host>example.com</host>
      <hostname>example.com</hostname>
      <port></port>
      <pathname>/apple-made-this-up</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>unregistered URI scheme, apparently hierarchical</comment>
  </test>
  <test>
    <uri>julian://example.com/julian-made-this-up</uri>
    <expected>
      <protocol>julian:</protocol>
      <host>example.com</host>
      <hostname>example.com</hostname>
      <port></port>
      <pathname>/julian-made-this-up</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>unregistered URI scheme, apparently hierarchical</comment>
  </test>
<!--  <test>
    <uri>http:///example.com/</uri>
    <expected>
      <protocol>http:</protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname></pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>three slashes</comment>
  </test>
  <test>
    <uri>http://example.com;</uri>
    <expected>
      <protocol>http:</protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname></pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>bad authority (";")</comment>
  </test>-->
  <test>
    <uri>opaquelocktoken:5fe6e7e0-1bb3-11df-9f3e-a5b17f9068f4</uri>
    <expected>
      <protocol>opaquelocktoken:</protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname>/5fe6e7e0-1bb3-11df-9f3e-a5b17f9068f4</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>maybe not hierarchical?</comment>
  </test>
  <test>
    <uri>urn:ietf:rfc:3986</uri>
    <expected>
      <protocol>urn:</protocol>
      <host></host>
      <hostname></hostname>
      <port></port>
      <pathname>/ietf:rfc:3986</pathname>
      <search></search>
      <hash></hash>
    </expected>
    <comment>maybe not hierarchical?</comment>
  </test>
</tests>
