use strict;
use warnings;
use Test::More tests => 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->new_abs('http://a.b.c/d/../e/', 'http://a.b.c/'), 'http://a.b
+.c/e/' );
1;
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.
I would except cannonical to implement 6.2.2.3. It does implement other similar rules.
use strict;
use warnings;
use Test::More tests => 6;
use URI qw( );
is( URI->new('hTtP://a.b.c/' )->canonical, 'http://a.b.c/', 'R
+FC 3986, 6.2.2.1' );
is( URI->new('http://a.b.c/d/../e/')->canonical, 'http://a.b.c/e/', 'R
+FC 3986, 6.2.2.3' );
is( URI->new('http://a.b.c' )->canonical, 'http://a.b.c/', 'R
+FC 3986, 6.2.3' );
is( URI->new('http://a.b.c:' )->canonical, 'http://a.b.c/', 'R
+FC 3986, 6.2.3' );
is( URI->new('http://a.b.c:/' )->canonical, 'http://a.b.c/', 'R
+FC 3986, 6.2.3' );
is( URI->new('http://a.b.c:80/' )->canonical, 'http://a.b.c/', 'R
+FC 3986, 6.2.3' );
1;
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.
|