diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-25 01:06:42 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-25 01:06:42 +0000 |
commit | 9165b237ad8fae18b36d4d40d6e2ccfde7b136c7 (patch) | |
tree | 06530ddd6baa7e251c58b6b6729ed458da61a681 /t/old-absconf.t | |
download | URI-tarball-f55d0c723f9f4816be807e4b551fc5564d75954f.tar.gz |
Diffstat (limited to 't/old-absconf.t')
-rw-r--r-- | t/old-absconf.t | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/old-absconf.t b/t/old-absconf.t new file mode 100644 index 0000000..536f4d7 --- /dev/null +++ b/t/old-absconf.t @@ -0,0 +1,38 @@ +use strict; +use warnings; + +print "1..6\n"; + +use URI::URL qw(url); + +# Test configuration via some global variables. + +$URI::URL::ABS_REMOTE_LEADING_DOTS = 1; +$URI::URL::ABS_ALLOW_RELATIVE_SCHEME = 1; + +my $u1 = url("../../../../abc", "http://web/a/b"); + +print "not " unless $u1->abs->as_string eq "http://web/abc"; +print "ok 1\n"; + +{ + local $URI::URL::ABS_REMOTE_LEADING_DOTS; + print "not " unless $u1->abs->as_string eq "http://web/../../../abc"; + print "ok 2\n"; +} + + +$u1 = url("http:../../../../abc", "http://web/a/b"); +print "not " unless $u1->abs->as_string eq "http://web/abc"; +print "ok 3\n"; + +{ + local $URI::URL::ABS_ALLOW_RELATIVE_SCHEME; + print "not " unless $u1->abs->as_string eq "http:../../../../abc"; + print "ok 4\n"; + print "not " unless $u1->abs(undef,1)->as_string eq "http://web/abc"; + print "ok 5\n"; +} + +print "not " unless $u1->abs(undef,0)->as_string eq "http:../../../../abc"; +print "ok 6\n"; |