--- AnyEvent/t/handle/03_http_req.t 2008/04/27 16:56:17 1.1 +++ AnyEvent/t/handle/03_http_req.t 2008/04/27 20:05:21 1.5 @@ -1,9 +1,18 @@ #!/opt/perl/bin/perl + use strict; -use Test::More tests => 2; +use Test::More; +use AnyEvent::Impl::Perl; use AnyEvent; use AnyEvent::Socket; +unless ($ENV{PERL_ANYEVENT_NET_TESTS}) { + plan skip_all => "PERL_ANYEVENT_NET_TESTS environment variable not set"; + exit 0; +} + +plan tests => 2; + my $cv = AnyEvent->condvar; my $fbytes; @@ -11,7 +20,7 @@ my $ae_sock = AnyEvent::Socket->new ( - PeerAddr => "www.google.de:80", + PeerAddr => "www.google.com:80", on_eof => sub { $cv->broadcast }, on_error => sub { my ($ae_sock) = @_; @@ -20,7 +29,7 @@ }, on_connect => sub { my ($ae_sock, $error) = @_; - if ($error) { diag ("connect error: $!"); return } + if ($error) { diag ("connect error: $!"); $cv->broadcast; return } $ae_sock->read (10, sub { my ($ae_sock, $data) = @_;