diff options
author | Eric Wong <e@80x24.org> | 2023-01-30 22:50:07 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-31 00:27:05 +0000 |
commit | 5dbb060037ce3e3a3ba0812baa90c80eeee762af (patch) | |
tree | 4c61aef7f5822ede45c8c352320ed8bc5b7492b8 /xt/git-http-backend.t | |
parent | 155ee9cdaffd6232ef3c774d1a9f61d708fc8d6e (diff) | |
download | public-inbox-5dbb060037ce3e3a3ba0812baa90c80eeee762af.tar.gz |
We'll rely on defined(wantarray) to implicitly skip subtests, and memoize these to reduce syscalls, since tests should be short-lived enough to not be affected by new installations or removals of git/xapian-compact/curl/etc...
Diffstat (limited to 'xt/git-http-backend.t')
-rw-r--r-- | xt/git-http-backend.t | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xt/git-http-backend.t b/xt/git-http-backend.t index 1f3ba063..d78fe79f 100644 --- a/xt/git-http-backend.t +++ b/xt/git-http-backend.t @@ -1,14 +1,13 @@ +#!perl -w # Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # # Ensure buffering behavior in -httpd doesn't cause runaway memory use # or data corruption use strict; -use warnings; -use Test::More; +use v5.10.1; use POSIX qw(setsid); use PublicInbox::TestCommon; -use PublicInbox::Spawn qw(which); my $git_dir = $ENV{GIANT_GIT_DIR}; plan 'skip_all' => 'GIANT_GIT_DIR not defined' unless $git_dir; @@ -77,8 +76,7 @@ SKIP: { # make sure Last-Modified + If-Modified-Since works with curl my $nr = 6; skip 'no description', $nr unless -f "$git_dir/description"; my $mtime = (stat(_))[9]; - my $curl = which('curl'); - skip 'curl(1) not found', $nr unless $curl; + my $curl = require_cmd('curl', 1) or skip 'curl(1) not found', $nr; my $url = "http://$host:$port/description"; my $dst = "$tmpdir/desc"; is(xsys($curl, qw(-RsSf), '-o', $dst, $url), 0, 'curl -R'); |