From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AB58E21420 for ; Sun, 27 Jan 2019 04:03:43 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/14] t/qspawn.t: psgi_qx stderr test Date: Sun, 27 Jan 2019 04:03:34 +0000 Message-Id: <20190127040341.26107-8-e@80x24.org> In-Reply-To: <20190127040341.26107-1-e@80x24.org> References: <20190127040341.26107-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- t/qspawn.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/qspawn.t b/t/qspawn.t index 170e4d7..745ec4d 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)]); -- EW