From 0308b7313856713a539dde078048c755334f9ae2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Dec 2020 13:51:44 +0000 Subject: t/run: avoid uninitialized var on incomplete test Diagnosing an occasional FIFO failure in t/lei_to_mail.t... --- t/run.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/run.perl') 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: $!"; -- cgit v1.2.3-24-ge0c7