URI Testing


  1. URI Reference Resolution Examples (from 5.4 Reference Resolution Examples of draft-fielding-uri-rfc2396bis-05.txt)
  2. Resolution of reg-names with percent-encoding

URI Reference Resolution Examples Testing

This section lists the examples from 5.4 Reference Resolution Examples of draft-fielding-uri-rfc2396bis-05.txt for testing by visual comparison. To test, move or place the cursor over the relative URI in the second column (relative), and compare the generated URI (e.g. in the status bar) with the absolute URI in the third column. Do not try to activate any of the links; all URIs are fictuous. If the two URIs match exactly, this test is passed. If there is any difference, the test is failed. Please report test results to the URI mailing list (uri@w3.org; publicly archived). Test results are listed here. Please send comments on this page to Martin Dürst.

Base URI

The base URI for all the tests is http://a/b/c/d;p?q

5.4.1 Normal Examples

number relative absolute
1 g:h g:h
2 g http://a/b/c/g
3 ./g http://a/b/c/g
4 g/ http://a/b/c/g/
5 /g http://a/g
6 //g http://g
7 ?y http://a/b/c/d;p?y
8 g?y http://a/b/c/g?y
9 #s http://a/b/c/d;p?q#s
10 g#s http://a/b/c/g#s
11 g?y#s http://a/b/c/g?y#s
12 ;x http://a/b/c/;x
13 g;x http://a/b/c/g;x
14 g;x?y#s http://a/b/c/g;x?y#s
15 "" http://a/b/c/d;p?q
16 . http://a/b/c/
17 ./ http://a/b/c/
18 .. http://a/b/
19 ../ http://a/b/
20 ../g http://a/b/g
21 ../.. http://a/
22 ../../ http://a/
23 ../../g http://a/g

5.4.2 Abnormal Examples

number relative absolute
Although the following abnormal examples are unlikely to occur in normal practice, all URI parsers should be capable of resolving them consistently. Each example uses the same base as above.
Parsers must be careful in handling cases where there are more relative path ".." segments than there are hierarchical levels in the base URI's path. Note that the ".." syntax cannot be used to change the authority component of a URI.
31 ../../../g http://a/g
32 ../../../../g http://a/g
Similarly, parsers must remove the dot-segments "." and ".." when they are complete components of a path, but not when they are only part of a segment.
41 /./g http://a/g
42 /../g http://a/g
43 g. http://a/b/c/g.
44 .g http://a/b/c/.g
45 g.. http://a/b/c/g..
46 ..g http://a/b/c/..g
Less likely are cases where the relative URI reference uses unnecessary or nonsensical forms of the "." and ".." complete path segments.
51 ./../g http://a/b/g
52 ./g/. http://a/b/c/g/
53 g/./h http://a/b/c/g/h
54 g/../h http://a/b/c/h
55 g;x=1/./y http://a/b/c/g;x=1/y
56 g;x=1/../y http://a/b/c/y
Some applications fail to separate the reference's query and/or fragment components from a relative path before merging it with the base path and removing dot-segments. This error is rarely noticed, since typical usage of a fragment never includes the hierarchy ("/") character, and the query component is not normally used within relative references.
61 g?y/./x http://a/b/c/g?y/./x
62 g?y/../x http://a/b/c/g?y/../x
63 g#s/./x http://a/b/c/g#s/./x
64 g#s/../x http://a/b/c/g#s/../x
Some parsers allow the scheme name to be present in a relative URI reference if it is the same as the base URI scheme. This is considered to be a loophole in prior specifications of partial URI [RFC1630]. Its use should be avoided, but is allowed for backward compatibility.
71a http:g http:g (for strict parsers)
71b http:g http://a/b/c/g (for backward compatibility)

Additional examples

These examples don't appear in the URI spec, but work the same way as those above.

number relative absolute
81 ./g:h http://a/b/c/g:h

Resolution of reg-names with percent-encoding

The test should go to the same location as the crosscheck.

number test
101 http://www.w%33.org
101 cross check http://www.w3.org
using IDNs
111 http://r%C3%A4ksm%C3%B6rg%C3%A5s.josefsson.org
111 cross check http://xn--rksmrgs-5wao1o.josefsson.org
112 http://%E7%B4%8D%E8%B1%86.w3.mag.keio.ac.jp
112 cross check http://xn--99zt52a.w3.mag.keio.ac.jp
using very long IDNs or IDN labels
121 http://www.%E3%81%BB%E3%82%93%E3%81%A8%E3%81%86%E3%81%AB%E3%81%AA%E3%81%8C%E3%81%84%E3%82%8F%E3%81%91%E3%81%AE%E3%82%8F%E3%81%8B%E3%82%89%E3%81%AA%E3%81%84%E3%81%A9%E3%82%81%E3%81%84%E3%82%93%E3%82%81%E3%81%84%E3%81%AE%E3%82%89%E3%81%B9%E3%82%8B%E3%81%BE%E3%81%A0%E3%81%AA%E3%81%8C%E3%81%8F%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%81%9F%E3%82%8A%E3%81%AA%E3%81%84.w3.mag.keio.ac.jp/
121 cross check http://www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp/
122 http://%E3%81%BB%E3%82%93%E3%81%A8%E3%81%86%E3%81%AB%E3%81%AA%E3%81%8C%E3%81%84%E3%82%8F%E3%81%91%E3%81%AE%E3%82%8F%E3%81%8B%E3%82%89%E3%81%AA%E3%81%84%E3%81%A9%E3%82%81%E3%81%84%E3%82%93%E3%82%81%E3%81%84%E3%81%AE%E3%82%89%E3%81%B9%E3%82%8B%E3%81%BE%E3%81%A0%E3%81%AA%E3%81%8C%E3%81%8F%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%81%9F%E3%82%8A%E3%81%AA%E3%81%84.%E3%81%BB%E3%82%93%E3%81%A8%E3%81%86%E3%81%AB%E3%81%AA%E3%81%8C%E3%81%84%E3%82%8F%E3%81%91%E3%81%AE%E3%82%8F%E3%81%8B%E3%82%89%E3%81%AA%E3%81%84%E3%81%A9%E3%82%81%E3%81%84%E3%82%93%E3%82%81%E3%81%84%E3%81%AE%E3%82%89%E3%81%B9%E3%82%8B%E3%81%BE%E3%81%A0%E3%81%AA%E3%81%8C%E3%81%8F%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%81%9F%E3%82%8A%E3%81%AA%E3%81%84.%E3%81%BB%E3%82%93%E3%81%A8%E3%81%86%E3%81%AB%E3%81%AA%E3%81%8C%E3%81%84%E3%82%8F%E3%81%91%E3%81%AE%E3%82%8F%E3%81%8B%E3%82%89%E3%81%AA%E3%81%84%E3%81%A9%E3%82%81%E3%81%84%E3%82%93%E3%82%81%E3%81%84%E3%81%AE%E3%82%89%E3%81%B9%E3%82%8B%E3%81%BE%E3%81%A0%E3%81%AA%E3%81%8C%E3%81%8F%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%81%9F%E3%82%8A%E3%81%AA%E3%81%84.w3.mag.keio.ac.jp/
122 cross check http://xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3fg11amb5gzdb4wi9bya3kc6lra.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3fg11amb5gzdb4wi9bya3kc6lra.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp/