3 # $Header: op.regexp,v 3.0 89/10/18 15:31:02 lwall Locked $
5 open(TESTS,'re_tests') || open(TESTS,'t/re_tests') || die "Can't open re_tests";
10 print "1..$numtests\n";
11 open(TESTS,'re_tests') || open(TESTS,'t/re_tests') || die "Can't open re_tests";
13 ($pat, $subject, $result, $repl, $expect) = split(/[\t\n]/,$_);
14 $input = join(':',$pat,$subject,$result,$repl,$expect);
15 eval "\$match = (\$subject =~ \$pat); \$got = \"$repl\";";
17 if ($@ ne '') {print "ok $.\n";} else {print "not ok $.\n";}
19 elsif ($result eq 'n') {
20 if (!$match) {print "ok $.\n";} else {print "not ok $. $input => $got\n";}
23 if ($match && $got eq $expect) {
27 print "not ok $. $input => $got\n";