This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
run_multiple_progs: allow the EXPECT to contain only OPTIONS
authorTony Cook <tony@develop-help.com>
Mon, 14 Sep 2020 05:51:05 +0000 (15:51 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 4 Nov 2020 04:26:48 +0000 (04:26 +0000)
t/test.pl

index 8f58447..8c8902f 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -1113,6 +1113,7 @@ sub fresh_perl_like {
 #   regex - the expected output is a regular expression
 #   random - all lines match but in any order
 #   fatal - the code will fail fatally (croak, die)
+#   nonfatal - the code is not expected to fail fatally
 #
 # If the actual output contains a line "SKIPPED" the test will be
 # skipped.
@@ -1321,7 +1322,7 @@ sub run_multiple_progs {
        my $option_regex = 0;
        my $option_random = 0;
        my $fatal = $FATAL;
-       if ($expected =~ s/^OPTIONS? (.+)\n//) {
+       if ($expected =~ s/^OPTIONS? (.+)(?:\n|\Z)//) {
            foreach my $option (split(' ', $1)) {
                if ($option eq 'regex') { # allow regular expressions
                    $option_regex = 1;