blob: d086e93cc0322778b0e45ec06cde74e35147e340 (
plain)
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
47
48
|
use strict;
use warnings;
print "1..7\n";
use URI ();
my $u = URI->new('mailto:gisle@aas.no');
print "not " unless $u->to eq 'gisle@aas.no' &&
$u eq 'mailto:gisle@aas.no';
print "ok 1\n";
my $old = $u->to('larry@wall.org');
print "not " unless $old eq 'gisle@aas.no' &&
$u->to eq 'larry@wall.org' &&
$u eq 'mailto:larry@wall.org';
print "ok 2\n";
$u->to("?/#");
print "not " unless $u->to eq "?/#" &&
$u eq 'mailto:%3F/%23';
print "ok 3\n";
my @h = $u->headers;
print "not " unless @h == 2 && "@h" eq "to ?/#";
print "ok 4\n";
$u->headers(to => 'gisle@aas.no',
cc => 'gisle@ActiveState.com,larry@wall.org',
Subject => 'How do you do?',
garbage => '/;?#=&',
);
@h = $u->headers;
print "not " unless $u->to eq 'gisle@aas.no' &&
@h == 8 &&
"@h" eq 'to gisle@aas.no cc gisle@ActiveState.com,larry@wall.org Subject How do you do? garbage /;?#=&';
print "ok 5\n";
#print "$u\n";
print "not " unless $u eq 'mailto:gisle@aas.no?cc=gisle%40ActiveState.com%2Clarry%40wall.org&Subject=How+do+you+do%3F&garbage=%2F%3B%3F%23%3D%26';
print "ok 6\n";
$u = URI->new("mailto:");
$u->to("gisle");
print "not " unless $u eq 'mailto:gisle';
print "ok 7\n";
|