blob: 536f4d768f81962f47d2e81af7d463a353c4e15a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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";
|