This is an automatically generated mail to inform you that tests are now available in at least one of these files: t/spec/S32-array/push.t, t/spec/S32-array/unshift.t
commit d1d53c0423c9ed041a5ee7ad691bed61d655a494 Author: bbkr <b...@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Mon Aug 2 10:20:34 2010 +0000 [t/spec] tests for RT #69548 .push allows freaky action-at-a-distance in Rakudo git-svn-id: http://svn.pugscode.org/p...@31887 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S32-array/push.t b/t/spec/S32-array/push.t index d2dd721..c0c7a6b 100644 --- a/t/spec/S32-array/push.t +++ b/t/spec/S32-array/push.t @@ -9,7 +9,7 @@ Push tests =end description -plan 50; +plan 51; # basic push tests { @@ -157,17 +157,17 @@ plan 50; my @a = (); push @a, $x; ++$x; - + is @a[0], 1, 'New element created by push(@a, $x) isn\'t affected by changes to $x'; } - # { - # my $x = 1; - # my @a = (); - # push @a, $x; - # +...@a[0]; - # - # is $x, 1, '$x isn\'t affected by changes to new element created by push(@a, $x)'; - # } + { + my $x = 1; + my @a = (); + push @a, $x; + +...@a[0]; + + is $x, 1, '$x isn\'t affected by changes to new element created by push(@a, $x)'; + } } diff --git a/t/spec/S32-array/unshift.t b/t/spec/S32-array/unshift.t index b126e19..cf989c2 100644 --- a/t/spec/S32-array/unshift.t +++ b/t/spec/S32-array/unshift.t @@ -9,7 +9,7 @@ Unshift tests =end description -plan 59; +plan 61; # basic unshift tests @@ -145,4 +145,25 @@ plan 59; # # best not to uncomment this it just go on forever # todo_throws_ok { 'unshift @unshift, 10' }, '?? what should this error message be ??', 'cannot unshift onto a Inf array'; # } + +# RT #69548 +{ + { + my $x = 1; + my @a = (); + unshift @a, $x; + ++$x; + + is @a[0], 1, 'New element created by unshift(@a, $x) isn\'t affected by changes to $x'; + } + { + my $x = 1; + my @a = (); + unshift @a, $x; + +...@a[0]; + + is $x, 1, '$x isn\'t affected by changes to new element created by unshift(@a, $x)'; + } +} + # vim: ft=perl6