Debian lenny version packages
[pkg-perl] / deb-src / liburi-perl / liburi-perl-1.35.dfsg.1 / t / rtsp.t
1 #!perl -w
2
3 print "1..9\n";
4
5 use URI;
6
7 $u = URI->new("<rtsp://media.perl.com/fôo.smi/>");
8
9 #print "$u\n";
10 print "not " unless $u eq "rtsp://media.perl.com/f%F4o.smi/";
11 print "ok 1\n";
12
13 print "not " unless $u->port == 554;
14 print "ok 2\n";
15
16 # play with port
17 $old = $u->port(8554);
18 print "not " unless $old == 554 && $u eq "rtsp://media.perl.com:8554/f%F4o.smi/";
19 print "ok 3\n";
20
21 $u->port(554);
22 print "not " unless $u eq "rtsp://media.perl.com:554/f%F4o.smi/";
23 print "ok 4\n";
24
25 $u->port("");
26 print "not " unless $u eq "rtsp://media.perl.com:/f%F4o.smi/" && $u->port == 554;
27 print "ok 5\n";
28
29 $u->port(undef);
30 print "not " unless $u eq "rtsp://media.perl.com/f%F4o.smi/";
31 print "ok 6\n";
32
33 print "not " unless $u->host eq "media.perl.com";
34 print "ok 7\n";
35
36 print "not " unless $u->path eq "/f%F4o.smi/";
37 print "ok 8\n";
38
39 $u->scheme("rtspu");
40 print "not " unless $u->scheme eq "rtspu";
41 print "ok 9\n";
42