]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/run.perl
lei add-external: completion for existing URL basenames
[public-inbox.git] / t / run.perl
index 1c7bcfc34db6fc3a24f28e468ee3d0d2f6f0827c..96db3045a04f535eeed8413dda419ef4bc3f1547 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Parallel test runner which preloads code and reuses worker processes
@@ -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: $!";
@@ -127,7 +128,7 @@ my $eof; # we stop respawning if true
 
 my $start_worker = sub {
        my ($i, $j, $rd, $todo) = @_;
-       defined(my $pid = fork) or DIE "fork: $!";
+       my $pid = fork // DIE "fork: $!";
        if ($pid == 0) {
                $worker = $$;
                while (1) {