about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-22 07:57:06 +0000
committerEric Wong <e@80x24.org>2019-01-26 23:05:46 +0000
commitb8655db863d42a023a32c4604e10ee2acb619aa9 (patch)
tree18af40f3dff7c1d02f732b6e6027e9a7541d11f9 /t
parenta6c9e09129dfc34fbd1b9bc757dc201fb9ff77c3 (diff)
downloadpublic-inbox-b8655db863d42a023a32c4604e10ee2acb619aa9.tar.gz
Diffstat (limited to 't')
-rw-r--r--t/qspawn.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/qspawn.t b/t/qspawn.t
index 170e4d7f..745ec4d8 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)]);