ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/06_socket.t
Revision: 1.1
Committed: Thu Jul 17 15:21:02 2008 UTC (15 years, 10 months ago) by root
Content type: application/x-troff
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 $|=1;
2     BEGIN { print "1..17\n" }
3    
4     no warnings; # nazis
5    
6     use AnyEvent::Socket;
7    
8     print "ok 1\n";
9    
10     sub ph {
11     my ($id, $str, $dport, $host, $port) = @_;
12    
13     $str =~ s/_/ /g;
14    
15     my ($h, $p) = parse_hostport $str, $dport;
16    
17     print $h eq $host && $p eq $port ? "" : "not ", "ok $id # '$str,$dport' => '$h,$p' eq '$host,$port'\n";
18     }
19    
20     ph 2, "";
21     ph 3, "localhost";
22     ph 4, qw(localhost 443 localhost 443);
23     ph 5, qw(localhost:444 443 localhost 444);
24     ph 6, qw(10.0.0.1 443 10.0.0.1 443);
25     ph 7, qw(10.1:80 443 10.1 80);
26     ph 8, qw(::1 443 ::1 443);
27     ph 9, qw(::1:80 443 ::1:80 443);
28     ph 10, qw([::1]:80 443 ::1 80);
29     ph 11, qw([::1]_80 443 ::1 80);
30     ph 12, qw([::1]_: 443);
31     ph 13, qw([::1]: 443);
32     ph 14, qw(::1_smtp 443 ::1 smtp);
33     ph 15, qw([www.linux.org]_80 443 www.linux.org 80);
34     ph 16, qw([10.1]:80 443 10.1 80);
35     ph 17, qw(10.1_80 443 10.1 80);
36