about summary refs log tree commit homepage
path: root/t/spawn.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-04 00:43:14 +0000
committerEric Wong <e@80x24.org>2019-11-04 02:06:41 +0000
commitb32b47fb12a3043d748f723802de923d9043d7ff (patch)
tree07291642fea1324a2469ecb9febc5fb4a5789d23 /t/spawn.t
parent17d2778c404c25c459f320a7f92913d17569fc59 (diff)
downloadpublic-inbox-b32b47fb12a3043d748f723802de923d9043d7ff.tar.gz
While I've never seen "git log" fail on its own, it could happen
one day and we should be prepared to abort indexing when it
happens.

Beef up tests for t/spawn.t to ensure close() behaves
on popen_rd the way we expect it to.
Diffstat (limited to 't/spawn.t')
-rw-r--r--t/spawn.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/spawn.t b/t/spawn.t
index aba1a26c..ebebfb57 100644
--- a/t/spawn.t
+++ b/t/spawn.t
@@ -71,13 +71,13 @@ use PublicInbox::Spawn qw(which spawn popen_rd);
         is($buf, "hello\n", 'tied gets works');
         is(sysread($fh, $buf, 6), 0, 'sysread got EOF');
         $? = 1;
-        close $fh;
+        ok(close($fh), 'close succeeds');
         is($?, 0, '$? set properly');
 }
 
 {
         my $fh = popen_rd([qw(false)]);
-        close $fh;
+        ok(!close($fh), 'close fails on false');
         isnt($?, 0, '$? set properly: '.$?);
 }