summaryrefslogtreecommitdiff
path: root/t/op/repeat.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/repeat.t')
-rw-r--r--t/op/repeat.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/repeat.t b/t/op/repeat.t
index 1174c4e961..15cf66eb89 100644
--- a/t/op/repeat.t
+++ b/t/op/repeat.t
@@ -6,7 +6,7 @@ BEGIN {
}
require './test.pl';
-plan(tests => 46);
+plan(tests => 47);
# compile time
@@ -141,6 +141,16 @@ is($y, undef, ' no extra values on stack');
# operand of the eq binop needs to remain!
is(77, scalar ((1,7)x2), 'stack truncation');
+# ( )x in void context should not read preceding stack items
+package Tiecount {
+ sub TIESCALAR { bless[]} sub FETCH { our $Tiecount++; study; 3 }
+}
+sub nil {}
+tie my $t, "Tiecount";
+{ push my @temp, $t, scalar((nil) x 3, 1) }
+is($Tiecount::Tiecount, 1,
+ '(...)x... in void context in list (via scalar comma)');
+
# perlbug 20011113.110 works in 5.6.1, broken in 5.7.2
{