summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-04-01 11:37:33 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:50 +0100
commitfca7221246069070a65ab8fbc4fa10405266be20 (patch)
treeca1081b510ff18573cb22dcb4285e709b549b0ec /t
parent1008bb63303d54d6d4b07526487d1752ee8cb755 (diff)
downloadperl-fca7221246069070a65ab8fbc4fa10405266be20.tar.gz
add some more tests for PL_cv_has_eval
In particular, the use re 'eval' case wasn't tested for
Diffstat (limited to 't')
-rw-r--r--t/op/closure.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/op/closure.t b/t/op/closure.t
index 7846b37663..322b592176 100644
--- a/t/op/closure.t
+++ b/t/op/closure.t
@@ -683,4 +683,23 @@ BEGIN {
is($blonk_was_called, 1, 'RT #63540');
}
+# test PL_cv_has_eval. Any anon sub that could conceivably contain an
+# eval, should be marked as cloneable
+
+{
+
+ my @s;
+ push @s, sub { eval '1' } for 1,2;
+ isnt($s[0], $s[1], "cloneable with eval");
+ @s = ();
+ push @s, sub { use re 'eval'; my $x; s/$x/1/; } for 1,2;
+ isnt($s[0], $s[1], "cloneable with use re eval");
+ @s = ();
+ push @s, sub { s/1/1/ee; } for 1,2;
+ isnt($s[0], $s[1], "cloneable with //ee");
+}
+
+
+
+
done_testing();