File: rtsp.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 (42 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (5)
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
#!perl -w

print "1..9\n";

use URI;

$u = URI->new("<rtsp://media.perl.com/fo.smi/>");

#print "$u\n";
print "not " unless $u eq "rtsp://media.perl.com/f%F4o.smi/";
print "ok 1\n";

print "not " unless $u->port == 554;
print "ok 2\n";

# play with port
$old = $u->port(8554);
print "not " unless $old == 554 && $u eq "rtsp://media.perl.com:8554/f%F4o.smi/";
print "ok 3\n";

$u->port(554);
print "not " unless $u eq "rtsp://media.perl.com:554/f%F4o.smi/";
print "ok 4\n";

$u->port("");
print "not " unless $u eq "rtsp://media.perl.com:/f%F4o.smi/" && $u->port == 554;
print "ok 5\n";

$u->port(undef);
print "not " unless $u eq "rtsp://media.perl.com/f%F4o.smi/";
print "ok 6\n";

print "not " unless $u->host eq "media.perl.com";
print "ok 7\n";

print "not " unless $u->path eq "/f%F4o.smi/";
print "ok 8\n";

$u->scheme("rtspu");
print "not " unless $u->scheme eq "rtspu";
print "ok 9\n";