Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / liburi-perl / liburi-perl-1.35.dfsg.1 / t / old-absconf.t
1 #!perl -w
2
3 print "1..6\n";
4
5 use URI::URL qw(url);
6
7 # Test configuration via some global variables.
8
9 $URI::URL::ABS_REMOTE_LEADING_DOTS = 1;
10 $URI::URL::ABS_ALLOW_RELATIVE_SCHEME = 1;
11
12 $u1 = url("../../../../abc", "http://web/a/b");
13
14 print "not " unless $u1->abs->as_string eq "http://web/abc";
15 print "ok 1\n";
16
17 {
18     local $URI::URL::ABS_REMOTE_LEADING_DOTS;
19     print "not " unless $u1->abs->as_string eq "http://web/../../../abc";
20     print "ok 2\n";
21 }
22
23
24 $u1 = url("http:../../../../abc", "http://web/a/b");
25 print "not " unless $u1->abs->as_string eq "http://web/abc";
26 print "ok 3\n";
27
28 {
29    local $URI::URL::ABS_ALLOW_RELATIVE_SCHEME;
30    print "not " unless $u1->abs->as_string eq "http:../../../../abc";
31    print "ok 4\n";
32    print "not " unless $u1->abs(undef,1)->as_string eq "http://web/abc";
33    print "ok 5\n";
34 }
35
36 print "not " unless $u1->abs(undef,0)->as_string eq "http:../../../../abc";
37 print "ok 6\n";