3 # $Header: regexp.t,v 4.0 91/03/20 01:54:22 lwall Locked $
5 open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
6 || die "Can't open re_tests";
11 print "1..$numtests\n";
12 open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
13 || die "Can't open re_tests";
15 ($pat, $subject, $result, $repl, $expect) = split(/[\t\n]/,$_);
16 $input = join(':',$pat,$subject,$result,$repl,$expect);
17 eval "\$match = (\$subject =~ \$pat); \$got = \"$repl\";";
19 if ($@ ne '') {print "ok $.\n";} else {print "not ok $.\n";}
21 elsif ($result eq 'n') {
22 if (!$match) {print "ok $.\n";} else {print "not ok $. $input => $got\n";}
25 if ($match && $got eq $expect) {
29 print "not ok $. $input => $got\n";