1#!perl -w
2
3print "1..8\n";
4
5use URI;
6
7$u = URI->new('pop://aas@pop.sn.no');
8
9print "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';
14print "ok 1\n";
15
16$u->auth("+APOP");
17print "not " unless $u->auth eq "+APOP" &&
18                    $u eq 'pop://aas;AUTH=+APOP@pop.sn.no';
19print "ok 2\n";
20
21$u->user("gisle");
22print "not " unless $u->user eq "gisle" &&
23	            $u eq 'pop://gisle;AUTH=+APOP@pop.sn.no';
24print "ok 3\n";
25
26$u->port(4000);
27print "not " unless $u eq 'pop://gisle;AUTH=+APOP@pop.sn.no:4000';
28print "ok 4\n";
29
30$u = URI->new("pop:");
31$u->host("pop.sn.no");
32$u->user("aas");
33$u->auth("*");
34print "not " unless $u eq 'pop://aas;AUTH=*@pop.sn.no';
35print "ok 5\n";
36
37$u->auth(undef);
38print "not " unless $u eq 'pop://aas@pop.sn.no';
39print "ok 6\n";
40
41$u->user(undef);
42print "not " unless $u eq 'pop://pop.sn.no';
43print "ok 7\n";
44
45# Try some funny characters too
46$u->user('f�r;k@l');
47print "not " unless $u->user eq 'f�r;k@l' &&
48                    $u eq 'pop://f%E5r%3Bk%40l@pop.sn.no';
49print "ok 8\n";
50