about summary refs log tree commit homepage
path: root/t/ds-leak.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-13 20:53:50 +0000
committerEric Wong <e@80x24.org>2021-09-13 21:11:13 +0000
commit04657044bb3695d70298624eb25394fb864fb718 (patch)
treefce610c4e7c2b3a7287d9a3cbde42bfc2ff36bfa /t/ds-leak.t
parentdc489bfd4b4c659b7ebb166ab540b4e767e51aaa (diff)
downloadpublic-inbox-04657044bb3695d70298624eb25394fb864fb718.tar.gz
t/v2mirror.t and t/lei-mirror.t are now skipped when curl
is missing (instead of failing in appropriate places).
A bunch of which() checks are updated to use require_cmd
to avoid explicitly loading Spawn.
Diffstat (limited to 't/ds-leak.t')
-rw-r--r--t/ds-leak.t9
1 files changed, 3 insertions, 6 deletions
diff --git a/t/ds-leak.t b/t/ds-leak.t
index 57d9cd72..4c211639 100644
--- a/t/ds-leak.t
+++ b/t/ds-leak.t
@@ -3,14 +3,11 @@
 # License: GPL-1.0+ or Artistic-1.0-Perl
 #  <https://www.gnu.org/licenses/gpl-1.0.txt>
 #  <https://dev.perl.org/licenses/artistic.html>
-use strict;
-use warnings;
-use Test::More;
-use PublicInbox::TestCommon;
+use strict; use v5.10.1; use PublicInbox::TestCommon;
 use_ok 'PublicInbox::DS';
 
 if ('close-on-exec for epoll and kqueue') {
-        use PublicInbox::Spawn qw(spawn which);
+        use PublicInbox::Spawn qw(spawn);
         my $pid;
         my $evfd_re = qr/(?:kqueue|eventpoll)/i;
 
@@ -32,7 +29,7 @@ if ('close-on-exec for epoll and kqueue') {
         is($l, undef, 'cloexec works and sleep(1) is running');
 
         SKIP: {
-                my $lsof = which('lsof') or skip 'lsof missing', 1;
+                my $lsof = require_cmd('lsof', 1) or skip 'lsof missing', 1;
                 my $rdr = { 2 => \(my $null) };
                 my @of = grep(/$evfd_re/, xqx([$lsof, '-p', $pid], {}, $rdr));
                 my $err = $?;