This is an automatically generated mail to inform you that tests are now available in t/spec/S32-array/push.t
commit 41a786ddea8e7eddeed7a8bf58340d2d62babd1b Author: Kodi <k...@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Sun Oct 4 20:57:41 2009 +0000 [t/spec/S32-array/push.t] Added a test for RT #69548 git-svn-id: http://svn.pugscode.org/p...@28608 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S32-array/push.t b/t/spec/S32-array/push.t index fd6005d..bce61af 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 52; # basic push tests { @@ -26,17 +26,17 @@ plan 50; is(@push[1], 2, 'we found the right element'); push(@push, 3); - is(+...@push, 3, 'we have 3 element in the array'); + is(+...@push, 3, 'we have 3 elements in the array'); is(@push[2], 3, 'we found the right element'); push(@push, 4); - is(+...@push, 4, 'we have 4 element in the array'); + is(+...@push, 4, 'we have 4 elements in the array'); is(@push[3], 4, 'we found the right element'); #?rakudo skip 'named args' { push(:array(@push), 5); - is(+...@push, 5, 'we have 5 element in the array (with named arg)'); + is(+...@push, 5, 'we have 5 elements in the array (with named arg)'); is(@push[4], 5, 'we found the right element (with named arg)'); } } @@ -151,4 +151,25 @@ plan 50; is(@push[0][*-1], 25, 'nested arrayref, last value is 25'); } +# RT #69548 +{ + { + my $x = 1; + 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)'; + } +} + + # vim: syn=perl6