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-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 6EFAA1FFB1 for ; Thu, 31 Dec 2020 13:51:57 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 26/36] t/run: avoid uninitialized var on incomplete test Date: Thu, 31 Dec 2020 13:51:44 +0000 Message-Id: <20201231135154.6070-27-e@80x24.org> In-Reply-To: <20201231135154.6070-1-e@80x24.org> References: <20201231135154.6070-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Diagnosing an occasional FIFO failure in t/lei_to_mail.t... --- t/run.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/run.perl b/t/run.perl index 1c7bcfc3..5c056356 100755 --- a/t/run.perl +++ b/t/run.perl @@ -71,7 +71,8 @@ sub test_status () { my $skip = ''; if (open my $fh, '<', $log) { my @not_ok = grep(!/^(?:ok |[ \t]*#)/ms, <$fh>); - pop @not_ok if $not_ok[-1] =~ /^[0-9]+\.\.[0-9]+$/; + my $last = $not_ok[-1] // ''; + pop @not_ok if $last =~ /^[0-9]+\.\.[0-9]+$/; my $pfx = "# $log: "; print $OLDERR map { $pfx.$_ } @not_ok; seek($fh, 0, SEEK_SET) or die "seek: $!";