summaryrefslogtreecommitdiff
path: root/t/op/repeat.t
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2001-03-24 14:33:09 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-24 16:22:33 +0000
commitb80b6069675e4e4c5169294fdad71ea1b2b85824 (patch)
tree2a1226beaaee30000b660e56be5f41fd13e3a442 /t/op/repeat.t
parentac5fe96247f4a41c9f94d27f22ec6c765f5c05be (diff)
downloadperl-b80b6069675e4e4c5169294fdad71ea1b2b85824.tar.gz
Re: B::Deparse bug (5.6.0)
Message-ID: <20010324143309.B17734@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9325
Diffstat (limited to 't/op/repeat.t')
-rwxr-xr-xt/op/repeat.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/repeat.t b/t/op/repeat.t
index c030ba9a12..26f567d565 100755
--- a/t/op/repeat.t
+++ b/t/op/repeat.t
@@ -2,7 +2,7 @@
# $RCSfile: repeat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:21 $
-print "1..20\n";
+print "1..23\n";
# compile time
@@ -96,3 +96,16 @@ print join('', (split(//,"123")) x 2) eq '123123' ? "ok 19\n" : "not ok 19\n";
# jhi@iki.fi
#
print "\xdd" x 24 eq "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" ? "ok 20\n" : "not ok 20\n";
+
+# When we use a list repeat in a scalar context, it behaves like
+# a scalar repeat. Make sure that works properly, and doesn't leave
+# extraneous values on the stack.
+# -- robin@kitsite.com
+
+my ($x, $y) = scalar ((1,2)x2);
+print $x eq "22" ? "ok 21\n" : "not ok 21\n";
+print !defined $y ? "ok 22\n" : "not ok 22\n";
+
+# Make sure the stack doesn't get truncated too much - the left
+# operand of the eq binop needs to remain!
+print (77 eq scalar ((1,7)x2) ? "ok 23\n" : "not ok 23\n");