Skip to content

Commit 0806125

Browse files
author
Jan-Olof Hendig
committed
Add tests for RT #126703
1 parent 00c4d36 commit 0806125

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

S09-multidim/assign.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 54;
4+
plan 59;
55

66
lives-ok { my @a[3] = 1, 2, 3 },
77
'Can assign exact number of elements to fixed size array';
@@ -111,3 +111,14 @@ lives-ok { my int @nx[2;2] = (0, 1), (2, 3); my @x[2;2] = @nx },
111111
'Can assign native shaped to non-native shaped';
112112
lives-ok { my @x[2;2] = (0, 1), (2, 3); my int @nx[2;2] = @x },
113113
'Can assign non-native shaped to native shaped';
114+
115+
# RT #126703
116+
{
117+
lives-ok { my Str @a[3;3] = <a b c>, <d e f>, <g h i> },
118+
'Can assign list of lists that matches shape of typed 2-dim array';
119+
my Str @b[2;2] = <a b>, <c d>;
120+
is @b[0;0], 'a', 'Assignment to typed 2-dim array works (1)';
121+
is @b[0;1], 'b', 'Assignment to typed 2-dim array works (2)';
122+
is @b[1;0], 'c', 'Assignment to typed 2-dim array works (3)';
123+
is @b[1;1], 'd', 'Assignment to typed 2-dim array works (4)';
124+
}

0 commit comments

Comments
 (0)