ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/06_socket.t
Revision: 1.3
Committed: Sat Jul 18 00:05:29 2009 UTC (14 years, 10 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-5_28, rel-5_29, rel-7_0, rel-5_21, rel-6_0, rel-6_1, rel-5_24, rel-5_26, rel-5_27, rel-5_12, rel-5_1, rel-5_0, rel-5_3, rel-5_2, rel-6_14, rel-5_22, rel-6_11, rel-6_12, rel-6_13, rel-5_261, rel-7_04, rel-7_05, rel-7_07, rel-7_01, rel-7_02, rel-7_03, rel-5_201, rel-5_202, rel-7_08, rel-7_09, rel-5_11, rel-5_23, rel-4_86, rel-4_881, rel-5_31, rel-4_88, rel-5_01, rel-6_02, rel-6_01, rel-5_111, rel-5_112, rel-0_85, rel-5_271, rel-7_16, rel-7_15, rel-7_14, rel-7_13, rel-7_12, rel-7_11, rel-5_251, rel-4_91, rel-4_9, HEAD
Changes since 1.2: +1 -2 lines
Log Message:
*** empty log message ***

File Contents

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