summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-03 14:06:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-03 14:06:14 -0700
commite47aeb2216a047eb0bd36de07ff716103c3d29c5 (patch)
tree8b756fc3aec879e6e2ef9cd7b602a73e12cfe460 /t
parent2ec31dd9f923af3a899842b086bdc04c45569b29 (diff)
downloadperl-e47aeb2216a047eb0bd36de07ff716103c3d29c5.tar.gz
Add a refgen+PADTMP test
Diffstat (limited to 't')
-rw-r--r--t/op/ref.t13
1 files changed, 11 insertions, 2 deletions
diff --git a/t/op/ref.t b/t/op/ref.t
index 52a4d2a011..91ba491c14 100644
--- a/t/op/ref.t
+++ b/t/op/ref.t
@@ -3,13 +3,13 @@
BEGIN {
chdir 't' if -d 't';
@INC = qw(. ../lib);
+ require 'test.pl';
}
-require 'test.pl';
use strict qw(refs subs);
use re ();
-plan(197);
+plan(198);
# Test glob operations.
@@ -121,6 +121,15 @@ is (join(':',@{$spring2{"foo"}}), "1:2:3:4");
is ($called, 1);
}
+# Test references to return values of operators (TARGs/PADTMPs)
+{
+ my @refs;
+ for("a", "b") {
+ push @refs, \"$_"
+ }
+ is join(" ", map $$_, @refs), "a b", 'refgen+PADTMP';
+}
+
$subrefref = \\&mysub2;
is ($$subrefref->("GOOD"), "good");
sub mysub2 { lc shift }