summaryrefslogtreecommitdiff
path: root/t/op/pat.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/pat.t')
-rwxr-xr-xt/op/pat.t18
1 files changed, 14 insertions, 4 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index fecdf0c199..7ee1f0943c 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -6,11 +6,14 @@
# $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $
-print "1..123\n";
+print "1..124\n";
-chdir 't' if -d 't';
-@INC = "../lib";
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = "../lib" if -d "../lib";
+}
eval 'use Config'; # Defaults assumed if this fails
+use re 'eval';
$x = "abc\ndef\n";
@@ -379,7 +382,14 @@ $test++;
$code = '{$blah = 45}';
$blah = 12;
-/(?$code)/;
+eval { /(?$code)/ };
+print "not " unless $@ and $@ =~ /not allowed at run time/ and $blah == 12;
+print "ok $test\n";
+$test++;
+
+$code = '{$blah = 45}';
+$blah = 12;
+eval "/(?$code)/";
print "not " if $blah != 45;
print "ok $test\n";
$test++;