X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Flei-sigpipe.t;h=d9738b07bd8e5ddce780e8125b1207a1686cc9ab;hb=7eeeea81c74c7184984510892871fd79406c0393;hp=f84d6d22ec4d410f77ba9b57ad8c61331ba3a13f;hpb=420fa1eac8cf0c73b6b0512c32206dc0b904dd45;p=public-inbox.git diff --git a/t/lei-sigpipe.t b/t/lei-sigpipe.t index f84d6d22..d9738b07 100644 --- a/t/lei-sigpipe.t +++ b/t/lei-sigpipe.t @@ -8,7 +8,7 @@ use POSIX qw(WTERMSIG WIFSIGNALED SIGPIPE); test_lei(sub { my $f = "$ENV{HOME}/big.eml"; my $imported; - for my $out ([], [qw(-f mboxcl2)]) { + for my $out ([], [qw(-f mboxcl2)], [qw(-f text)]) { pipe(my ($r, $w)) or BAIL_OUT $!; my $size = 65536; if ($^O eq 'linux' && fcntl($w, 1031, 4096)) { @@ -27,7 +27,7 @@ EOM } lei_ok(qw(import), $f) if $imported++ == 0; - open my $errfh, '>>', "$ENV{HOME}/stderr.log" or xbail $!; + open my $errfh, '+>', "$ENV{HOME}/stderr.log" or xbail $!; my $opt = { run_mode => 0, 2 => $errfh, 1 => $w }; my $cmd = [qw(lei q -q -t), @$out, 'z:1..']; my $tp = start_script($cmd, undef, $opt); @@ -37,6 +37,9 @@ EOM $tp->join; ok(WIFSIGNALED($?), "signaled @$out"); is(WTERMSIG($?), SIGPIPE, "got SIGPIPE @$out"); + seek($errfh, 0, 0) or xbail $!; + my $s = do { local $/; <$errfh> }; + is($s, '', "quiet after sigpipe @$out"); } });