perl 5.003_03: [patch introduction and re-organisation]
[p5sagit/p5-mst-13.2.git] / t / op / regexp.t
old mode 100644 (file)
new mode 100755 (executable)
index 92f084a..af8a666
@@ -1,6 +1,6 @@
 #!./perl
 
-# $Header: regexp.t,v 4.0 91/03/20 01:54:22 lwall Locked $
+# $RCSfile: regexp.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:20 $
 
 open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
     || die "Can't open re_tests";
@@ -11,10 +11,12 @@ close(TESTS);
 print "1..$numtests\n";
 open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
     || die "Can't open re_tests";
+$| = 1;
 while (<TESTS>) {
     ($pat, $subject, $result, $repl, $expect) = split(/[\t\n]/,$_);
     $input = join(':',$pat,$subject,$result,$repl,$expect);
-    eval "\$match = (\$subject =~ \$pat); \$got = \"$repl\";";
+    $pat = "'$pat'" unless $pat =~ /^'/;
+    eval "\$match = (\$subject =~ m$pat); \$got = \"$repl\";";
     if ($result eq 'c') {
        if ($@ ne '') {print "ok $.\n";} else {print "not ok $.\n";}
     }