File: rfc2732.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 (46 lines) | stat: -rw-r--r-- 1,323 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!perl -w

print "1..9\n";

use strict;
use URI;
my $uri = URI->new("http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html");

print "not " unless $uri->as_string eq "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";
print "ok 1\n";

print "not " unless $uri->host eq "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]";
print "ok 2\n";

print "not " unless $uri->host_port eq "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80";
print "ok 3\n";

print "not " unless $uri->port eq "80";
print "ok 4\n";

$uri->host("host");
print "not " unless $uri->as_string eq "http://host:80/index.html";
print "ok 5\n";

$uri = URI->new("ftp://ftp:@[3ffe:2a00:100:7031::1]");
print "not " unless $uri->as_string eq "ftp://ftp:@[3ffe:2a00:100:7031::1]";
print "ok 6\n";

print "not " unless $uri->port eq "21" && !$uri->_port;
print "ok 7\n";

print "not " unless $uri->host("ftp") eq "[3ffe:2a00:100:7031::1]";
print "ok 8\n";

print "not " unless $uri eq "ftp://ftp:\@ftp";
print "ok 9\n";

__END__

      http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html
      http://[1080:0:0:0:8:800:200C:417A]/index.html
      http://[3ffe:2a00:100:7031::1]
      http://[1080::8:800:200C:417A]/foo
      http://[::192.9.5.5]/ipng
      http://[::FFFF:129.144.52.38]:80/index.html
      http://[2010:836B:4179::836B:4179]