From 3eb26fe04dae68612c841e749abd2848ce78ae59 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 30 Jun 2019 22:19:38 +0000 Subject: tests: common tcp_server and unix_server helpers IO::Socket:*->new options are verbose and we can save a bunch of code by putting this into t/common.perl, since the related spawn_listener stuff is already there. --- t/www_listing.t | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 't/www_listing.t') diff --git a/t/www_listing.t b/t/www_listing.t index e5b797db..a5d81f38 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -73,14 +73,7 @@ SKIP: { my $v2 = "$tmpdir/v2"; my $httpd = 'blib/script/public-inbox-httpd'; use IO::Socket::INET; - my %opts = ( - LocalAddr => '127.0.0.1', - ReuseAddr => 1, - Proto => 'tcp', - Type => SOCK_STREAM, - Listen => 1024, - ); - my $sock = IO::Socket::INET->new(%opts); + my $sock = tcp_server(); ok($sock, 'sock created'); my ($host, $port) = ($sock->sockhost, $sock->sockport); my @clone = qw(git clone -q -s --bare); -- cgit v1.2.3-24-ge0c7