File: rel.t

package info (click to toggle)
liburi-perl 1.35.dfsg.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 540 kB
  • ctags: 258
  • sloc: perl: 4,293; makefile: 51
file content (21 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w

print "1..4\n";

use strict;
use URI;

my $uri = URI->new("http://www.example.com/foo/bar/");

print "not " unless $uri->rel("http://www.example.com/foo/bar/") eq "./";
print "ok 1\n";

print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM/foo/bar/") eq "./";
print "ok 2\n";

print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM/FOO/BAR/") eq "../../foo/bar/";
print "ok 3\n";

print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM:80/foo/bar/") eq "./";
print "ok 4\n";