]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/cgi.t: show stderr on failures
authorEric Wong <e@80x24.org>
Wed, 9 Sep 2020 06:26:14 +0000 (06:26 +0000)
committerEric Wong <e@80x24.org>
Thu, 10 Sep 2020 19:45:18 +0000 (19:45 +0000)
This helped me diagnose an error I would've introduced
in the next commit.

t/cgi.t

diff --git a/t/cgi.t b/t/cgi.t
index 366d6594bb007ca2f36d0e69b74b52db9410fe98..96c627c384e8d3ce1acf1c3a83d3eba0140d280b 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -158,7 +158,7 @@ sub cgi_run {
        my ($in, $out, $err) = ("", "", "");
        my $rdr = { 0 => \$in, 1 => \$out, 2 => \$err };
        run_script(['.cgi'], \%env, $rdr);
        my ($in, $out, $err) = ("", "", "");
        my $rdr = { 0 => \$in, 1 => \$out, 2 => \$err };
        run_script(['.cgi'], \%env, $rdr);
-       die "unexpected error: \$?=$?" if $?;
+       die "unexpected error: \$?=$? ($err)" if $?;
        my ($head, $body) = split(/\r\n\r\n/, $out, 2);
        { head => $head, body => $body, err => $err }
 }
        my ($head, $body) = split(/\r\n\r\n/, $out, 2);
        { head => $head, body => $body, err => $err }
 }