]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-corner.t
tests: move t/common.perl to PublicInbox::TestCommon
[public-inbox.git] / t / httpd-corner.t
index 551af2b21526c822e7f479186d668d4ed380be85..fb3ffcf1fba6abaadd38ca95ea754a8c2e56d947 100644 (file)
@@ -19,7 +19,7 @@ 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';
+use PublicInbox::TestCommon;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $fifo = "$tmpdir/fifo";
 ok(defined mkfifo($fifo, 0777), 'created FIFO');
@@ -553,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');