<?xml version="1.0" encoding="windows-1252"?>
<node id="900776" title="Re^4: Relative URI" created="2011-04-22 03:08:24" updated="2011-04-22 03:08:24">
<type id="11">
note</type>
<author id="381608">
ikegami</author>
<data>
<field name="doctext">
&lt;p&gt;There is a violation of 5.2 elsewhere, though.

&lt;c&gt;
use strict;
use warnings;

use Test::More tests =&gt; 1;

use URI qw( );

# if defined(R.scheme) then
#    T.scheme    = R.scheme;
#    T.authority = R.authority;
#    T.path      = remove_dot_segments(R.path);
#    T.query     = R.query;

is( URI-&gt;new_abs('http://a.b.c/d/../e/', 'http://a.b.c/'), 'http://a.b.c/e/' );

1;
&lt;/c&gt;

&lt;c&gt;
1..1
not ok 1
#   Failed test at a.pl line 8.
#          got: 'http://a.b.c/d/../e/'
#     expected: 'http://a.b.c/e/'
# Looks like you failed 1 test of 1.
&lt;/c&gt;

&lt;p&gt;I would except &lt;c&gt;cannonical&lt;/c&gt; to implement 6.2.2.3. It does implement other similar rules.

&lt;c&gt;
use strict;
use warnings;

use Test::More tests =&gt; 6;

use URI qw( );

is( URI-&gt;new('hTtP://a.b.c/'       )-&gt;canonical, 'http://a.b.c/',   'RFC 3986, 6.2.2.1' );

is( URI-&gt;new('http://a.b.c/d/../e/')-&gt;canonical, 'http://a.b.c/e/', 'RFC 3986, 6.2.2.3' );

is( URI-&gt;new('http://a.b.c'        )-&gt;canonical, 'http://a.b.c/',   'RFC 3986, 6.2.3' );
is( URI-&gt;new('http://a.b.c:'       )-&gt;canonical, 'http://a.b.c/',   'RFC 3986, 6.2.3' );
is( URI-&gt;new('http://a.b.c:/'      )-&gt;canonical, 'http://a.b.c/',   'RFC 3986, 6.2.3' );
is( URI-&gt;new('http://a.b.c:80/'    )-&gt;canonical, 'http://a.b.c/',   'RFC 3986, 6.2.3' );

1;
&lt;/c&gt;

&lt;c&gt;
1..6
ok 1 - RFC 3986, 6.2.2.1
not ok 2 - RFC 3986, 6.2.2.3
#   Failed test 'RFC 3986, 6.2.2.3'
#   at a.pl line 10.
#          got: 'http://a.b.c/d/../e/'
#     expected: 'http://a.b.c/e/'
ok 3 - RFC 3986, 6.2.3
ok 4 - RFC 3986, 6.2.3
ok 5 - RFC 3986, 6.2.3
ok 6 - RFC 3986, 6.2.3
# Looks like you failed 1 test of 6.
&lt;/c&gt;</field>
<field name="root_node">
900729</field>
<field name="parent_node">
900742</field>
</data>
</node>
