From b8655db863d42a023a32c4604e10ee2acb619aa9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 22 Jan 2019 07:57:06 +0000 Subject: t/qspawn.t: psgi_qx stderr test --- t/qspawn.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 't') 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 +# Copyright (C) 2016-2019 all contributors # License: AGPL-3.0+ 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)]); -- cgit v1.2.3-24-ge0c7