]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-corner.t
hval: from_attr: move to unit test
[public-inbox.git] / t / httpd-corner.t
index fb3ffcf1fba6abaadd38ca95ea754a8c2e56d947..4ed34934e500649470ba411629764afbe286f044 100644 (file)
@@ -7,19 +7,14 @@ use warnings;
 use Test::More;
 use Time::HiRes qw(gettimeofday tv_interval);
 use PublicInbox::Spawn qw(which spawn);
-
-foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) {
-       eval "require $mod";
-       plan skip_all => "$mod missing for httpd-corner.t" if $@;
-}
-
+use PublicInbox::TestCommon;
+require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status));
 use Digest::SHA qw(sha1_hex);
 use IO::Socket;
 use IO::Socket::UNIX;
 use Fcntl qw(:seek);
 use Socket qw(IPPROTO_TCP TCP_NODELAY SOL_SOCKET);
 use POSIX qw(mkfifo);
-use PublicInbox::TestCommon;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $fifo = "$tmpdir/fifo";
 ok(defined mkfifo($fifo, 0777), 'created FIFO');
@@ -271,7 +266,7 @@ SKIP: {
        my $cmd = [qw(curl --tcp-nodelay --no-buffer -T- -HExpect: -sS), $url];
        open my $cout, '+>', undef or die;
        open my $cerr, '>', undef or die;
-       my $rdr = { 0 => fileno($r), 1 => fileno($cout), 2 => fileno($cerr) };
+       my $rdr = { 0 => $r, 1 => $cout, 2 => $cerr };
        my $pid = spawn($cmd, undef, $rdr);
        close $r or die "close read pipe: $!";
        foreach my $c ('a'..'z') {