Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / liburi-perl / liburi-perl-1.35.dfsg.1 / t / pop.t
1 #!perl -w
2
3 print "1..8\n";
4
5 use URI;
6
7 $u = URI->new('pop://aas@pop.sn.no');
8
9 print "not " unless $u->user eq "aas" &&
10                     !defined($u->auth) &&
11                     $u->host eq "pop.sn.no" &&
12                     $u->port == 110 && 
13                     $u eq 'pop://aas@pop.sn.no';
14 print "ok 1\n";
15
16 $u->auth("+APOP");
17 print "not " unless $u->auth eq "+APOP" &&
18                     $u eq 'pop://aas;AUTH=+APOP@pop.sn.no';
19 print "ok 2\n";
20
21 $u->user("gisle");
22 print "not " unless $u->user eq "gisle" &&
23                     $u eq 'pop://gisle;AUTH=+APOP@pop.sn.no';
24 print "ok 3\n";
25
26 $u->port(4000);
27 print "not " unless $u eq 'pop://gisle;AUTH=+APOP@pop.sn.no:4000';
28 print "ok 4\n";
29
30 $u = URI->new("pop:");
31 $u->host("pop.sn.no");
32 $u->user("aas");
33 $u->auth("*");
34 print "not " unless $u eq 'pop://aas;AUTH=*@pop.sn.no';
35 print "ok 5\n";
36
37 $u->auth(undef);
38 print "not " unless $u eq 'pop://aas@pop.sn.no';
39 print "ok 6\n";
40
41 $u->user(undef);
42 print "not " unless $u eq 'pop://pop.sn.no';
43 print "ok 7\n";
44
45 # Try some funny characters too
46 $u->user('får;k@l');
47 print "not " unless $u->user eq 'får;k@l' &&
48                     $u eq 'pop://f%E5r%3Bk%40l@pop.sn.no';
49 print "ok 8\n";