1 | $|=1; |
1 | $|=1; |
2 | BEGIN { print "1..17\n" } |
2 | BEGIN { print "1..19\n" } |
3 | |
3 | |
4 | no warnings; # nazis |
4 | no warnings; # nazis |
5 | |
5 | |
6 | use AnyEvent::Socket; |
6 | use AnyEvent::Socket; |
7 | |
7 | |
8 | print "ok 1\n"; |
8 | print "ok 1\n"; |
9 | |
9 | |
10 | sub ph { |
10 | sub ph { |
11 | my ($id, $str, $dport, $host, $port) = @_; |
11 | my ($id, $str, $dport, $host, $port) = @_; |
12 | |
12 | |
13 | $str =~ s/_/ /g; |
13 | $str =~ s/_/ /g unless ref $str; |
14 | |
14 | |
15 | my ($h, $p) = parse_hostport $str, $dport; |
15 | my ($h, $p) = parse_hostport ref $str ? $$str : $str, $dport; |
16 | |
16 | |
17 | print $h eq $host && $p eq $port ? "" : "not ", "ok $id # '$str,$dport' => '$h,$p' eq '$host,$port'\n"; |
17 | print $h eq $host && $p eq $port ? "" : "not ", "ok $id # '$str,$dport' => '$h,$p' eq '$host,$port'\n"; |
18 | } |
18 | } |
19 | |
19 | |
20 | ph 2, ""; |
20 | ph 2, ""; |
… | |
… | |
32 | ph 14, qw(::1_smtp 443 ::1 smtp); |
32 | ph 14, qw(::1_smtp 443 ::1 smtp); |
33 | ph 15, qw([www.linux.org]_80 443 www.linux.org 80); |
33 | ph 15, qw([www.linux.org]_80 443 www.linux.org 80); |
34 | ph 16, qw([10.1]:80 443 10.1 80); |
34 | ph 16, qw([10.1]:80 443 10.1 80); |
35 | ph 17, qw(10.1_80 443 10.1 80); |
35 | ph 17, qw(10.1_80 443 10.1 80); |
36 | |
36 | |
|
|
37 | my $var = "2002:58c6:438b::10.0.0.17"; |
|
|
38 | ph 18, \$var, qw(443 2002:58c6:438b::10.0.0.17 443); |
|
|
39 | ph 19, \$var, qw(443 2002:58c6:438b::10.0.0.17 443); |
|
|
40 | |