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
|
use strict;
use warnings;
use LWP::Simple;
use Test::TCP;
use Test::More skip_all => 'Network test';
use Server::Starter qw(start_server);
my $another_port = empty_port(20000);
test_tcp(
server => sub {
my $port = shift;
start_server(
port => [ $port, $another_port ],
exec => [ $^X, qw(t/01-httpd.pl) ],
);
},
client => sub {
my $port = shift;
sleep 1;
like get("http://127.0.0.1:$port/"), qr/^\d+$/, 'check port 1';
like get("http://127.0.0.1:$another_port/"), qr/^\d+$/, 'check port 2';
},
);
|