about summary refs log tree commit homepage
path: root/t/qspawn.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-30 07:40:35 +0000
committerEric Wong <e@80x24.org>2019-01-30 07:40:35 +0000
commitcf439203c31836e4c48f632f902aa58db6924972 (patch)
treea46bf739c5318db857783a1b2773ed51ad2f0fde /t/qspawn.t
parent41bb8a962d4d2d8f6e7ec9988908aaf7d55f09c7 (diff)
parent11f984fa36647b0ab107596bcec2dd9b963f1379 (diff)
downloadpublic-inbox-cf439203c31836e4c48f632f902aa58db6924972.tar.gz
* origin/viewvcs: (66 commits)
  solvergit: deal with alternative diff prefixes
  solvergit: extract mode from diff headers properly
  solvergit: avoid "Wide character" warnings
  solvergit: do not show full path names to "git apply"
  css/216dark: add comments and tweak highlight colors
  viewvcs: avoid segfault with highlight.pm at shutdown
  solvergit: do not solve blobs twice
  t/check-www-inbox: disable history
  t/check-www-inbox: don't follow mboxes
  t/check-www-inbox: replace IPC::Run with PublicInbox::Spawn
  hval: add src_escape for highlight post-processing
  viewvcs: wire up syntax-highlighting for blobs
  hlmod: disable enclosing <pre> tag
  t/hl_mod: extra check to ensure we escape HTML
  wwwhighlight: read_in_full returns undef on errors
  solver: crank up max patches to 9999
  viewvcs: do not show final error message twice
  qspawn: decode $? for user-friendliness
  solver: reduce "git apply" invocations
  solver: hold patches in temporary directory
  ...
Diffstat (limited to 't/qspawn.t')
-rw-r--r--t/qspawn.t12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/qspawn.t b/t/qspawn.t
index 170e4d7f..ab6e3758 100644
--- a/t/qspawn.t
+++ b/t/qspawn.t
@@ -1,8 +1,16 @@
-# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use Test::More;
 use_ok 'PublicInbox::Qspawn';
 
+{
+        my $cmd = [qw(sh -c), 'echo >&2 err; echo out'];
+        my $qsp = PublicInbox::Qspawn->new($cmd, {}, { 2 => 1 });
+        my $res;
+        $qsp->psgi_qx({}, undef, sub { $res = ${$_[0]} });
+        is($res, "err\nout\n", 'captured stderr and stdout');
+}
+
 my $limiter = PublicInbox::Qspawn::Limiter->new(1);
 {
         my $x = PublicInbox::Qspawn->new([qw(true)]);
@@ -23,7 +31,7 @@ my $limiter = PublicInbox::Qspawn::Limiter->new(1);
                 my ($rpipe) = @_;
                 is(0, sysread($rpipe, my $buf, 1), 'read zero bytes from false');
                 my $err = $x->finish;
-                is($err, 256, 'error on finish');
+                ok($err, 'error on finish');
                 $run = 1;
         });
         is($run, 1, 'callback ran alright');