X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhttpd-corner.t;h=fb3ffcf1fba6abaadd38ca95ea754a8c2e56d947;hb=3c313f9034aac96182e2efdc2f92c40803626f32;hp=eca77d7fc6dd0f9e600f736d1ef6e534400f67a5;hpb=e05912ae3899a0f50a6baf3b6c1892789d24f6b1;p=public-inbox.git diff --git a/t/httpd-corner.t b/t/httpd-corner.t index eca77d7f..fb3ffcf1 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -14,14 +14,13 @@ foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) { } use Digest::SHA qw(sha1_hex); -use File::Temp qw/tempdir/; use IO::Socket; use IO::Socket::UNIX; use Fcntl qw(:seek); use Socket qw(IPPROTO_TCP TCP_NODELAY SOL_SOCKET); use POSIX qw(mkfifo); -require './t/common.perl'; -my $tmpdir = tempdir('httpd-corner-XXXXXX', TMPDIR => 1, CLEANUP => 1); +use PublicInbox::TestCommon; +my ($tmpdir, $for_destroy) = tmpdir(); my $fifo = "$tmpdir/fifo"; ok(defined mkfifo($fifo, 0777), 'created FIFO'); my $err = "$tmpdir/stderr.log"; @@ -554,16 +553,16 @@ SKIP: { # filter out pipes inherited from the parent my @this = `lsof -p $$`; my $bad; - sub extract_inodes { + my $extract_inodes = sub { map {; my @f = split(' ', $_); my $inode = $f[-2]; $bad = $_ if $inode !~ /\A[0-9]+\z/; $inode => 1; } grep (/\bpipe\b/, @_); - } - my %child = extract_inodes(@lsof); - my %parent = extract_inodes(@this); + }; + my %child = $extract_inodes->(@lsof); + my %parent = $extract_inodes->(@this); skip("inode not in expected format: $bad", 1) if defined($bad); delete @child{(keys %parent)}; is_deeply([], [keys %child], 'no extra pipes with -W0');