Skip to content

Commit

Permalink
Test container writeableness of .values and .pairs on shaped arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Mar 2, 2017
1 parent b896586 commit 1f5dead
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S02-types/array-shapes.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 29;
plan 31;

# L<S09/Fixed-size arrays>

Expand Down Expand Up @@ -119,3 +119,14 @@ subtest '.List on uninited shaped array' => {
# RT #130510
eval-lives-ok my @c[2;2] .= new(:shape(2, 2), <a b>, <c d>),
'@c[some shape] accepts a .new: :shape(same shape)...';

# RT #130440
{
my @a[1;1]; for @a.pairs -> $p { $p.value = 42 };
is-deeply @a[0;0], 42,
'@shaped-array.pairs provides with writable container in .value';

my @b[1]; for @b.values <-> $a { $a = 42 };
is-deeply @b[0], 42,
'@shaped-array.values provides with writable containers';
}

0 comments on commit 1f5dead

Please sign in to comment.