Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / liburi-perl / liburi-perl-1.35.dfsg.1 / t / old-relbase.t
1 #!perl -w
2
3 print "1..5\n";
4
5 use URI::URL;
6
7 # We used to have problems with URLs that used a base that was
8 # not absolute itself.
9
10 $u1 = url("/foo/bar", "http://www.acme.com/");
11 $u2 = url("../foo/", $u1);
12 $u3 = url("zoo/foo", $u2);
13
14 $a1 = $u1->abs->as_string;
15 $a2 = $u2->abs->as_string;
16 $a3 = $u3->abs->as_string;
17
18 print "$a1\n$a2\n$a3\n";
19
20 print "not " unless $a1 eq "http://www.acme.com/foo/bar";
21 print "ok 1\n";
22 print "not " unless $a2 eq "http://www.acme.com/foo/";
23 print "ok 2\n";
24 print "not " unless $a3 eq "http://www.acme.com/foo/zoo/foo";
25 print "ok 3\n";
26
27 # We used to have problems with URI::URL as the base class :-(
28 $u4 = url("foo", "URI::URL");
29 $a4 = $u4->abs;
30 print "$a4\n";
31 print "not " unless $u4 eq "foo" && $a4 eq "uri:/foo";
32 print "ok 4\n";
33
34 # Test new_abs for URI::URL objects
35 print "not " unless URI::URL->new_abs("foo", "http://foo/bar") eq "http://foo/foo";
36 print "ok 5\n";