File: 02_ip_literals.t

package info (click to toggle)
libanyevent-http-perl 2.25-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 248 kB
  • sloc: perl: 625; makefile: 6
file content (34 lines) | stat: -rw-r--r-- 557 bytes parent folder | download | duplicates (4)
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
BEGIN { $| = 1; print "1..23\n" }

use AnyEvent::Impl::Perl;

require AnyEvent::HTTP;

print "ok 1\n";

my $t = 2;

for my $auth (qw(
   0.42.42.42
   [0.42.42.42]:81
   [::0.42.42.42]:81
   [::0:2]
   [0:0::2]:80
   [::0:2]:81
   [0:0::2]:81
)) {
   my $cv = AE::cv;

   AnyEvent::HTTP::http_get ("http://$auth/", timeout => 1/128, sub {
      print $_[1]{Status} == 599 ? "not ": "", "ok ", $t + 1, " # $_[1]{Status} $auth\n";
      $cv->send;
   });

   print "ok ", $t, "\n";
   $cv->recv;
   print "ok ", $t + 2, "\n";

   $t += 3;
}

print "ok 23\n";