test.pl: Allow NAME to be used with --FILE--
authorKarl Williamson <public@khwilliamson.com>
Wed, 24 Oct 2012 16:28:55 +0000 (10:28 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 24 Oct 2012 16:45:26 +0000 (10:45 -0600)
Prior to this patch the --FILE-- feature of test.pl could not be used on
tests that had a name.  This is because --FILE-- is expecting a \n
before it, and NAME strips that off.  This commit just makes the \n
optional.

t/test.pl

index bf9269b..7d06d39 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -1014,7 +1014,7 @@ sub run_multiple_progs {
        }
 
        if ($prog =~ /--FILE--/) {
-           my @files = split(/\n--FILE--\s*([^\s\n]*)\s*\n/, $prog) ;
+           my @files = split(/\n?--FILE--\s*([^\s\n]*)\s*\n/, $prog) ;
            shift @files ;
            die "Internal error: test $_ didn't split into pairs, got " .
                scalar(@files) . "[" . join("%%%%", @files) ."]\n"