Skip to content

Commit 1f5dead

Browse files
committed
Test container writeableness of .values and .pairs on shaped arrays
RT#130440: https://rt.perl.org/Ticket/Display.html?id=130440 Rakudo fix: rakudo/rakudo@dc7b688
1 parent b896586 commit 1f5dead

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

S02-types/array-shapes.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 29;
3+
plan 31;
44

55
# L<S09/Fixed-size arrays>
66

@@ -119,3 +119,14 @@ subtest '.List on uninited shaped array' => {
119119
# RT #130510
120120
eval-lives-ok my @c[2;2] .= new(:shape(2, 2), <a b>, <c d>),
121121
'@c[some shape] accepts a .new: :shape(same shape)...';
122+
123+
# RT #130440
124+
{
125+
my @a[1;1]; for @a.pairs -> $p { $p.value = 42 };
126+
is-deeply @a[0;0], 42,
127+
'@shaped-array.pairs provides with writable container in .value';
128+
129+
my @b[1]; for @b.values <-> $a { $a = 42 };
130+
is-deeply @b[0], 42,
131+
'@shaped-array.values provides with writable containers';
132+
}

0 commit comments

Comments
 (0)