Skip to content

Commit

Permalink
Add tests for R#2257
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 12, 2018
1 parent 28dd0d8 commit eae3635
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 38;
plan 39;

# L<S09/Fixed-size arrays>

Expand Down Expand Up @@ -116,6 +116,17 @@ subtest '.List on uninited shaped array' => {
is-deeply @result, [Any xx 4], 'gives correct results';
}

# R#2257
subtest '.Array on uninited shaped array' => {
plan 3;

my @a[2;2];
my @result;
lives-ok { @result := @a.Array }, 'does not die';
is-deeply @result, [Any xx 4], 'gives correct results';
lives-ok { @result[0] = 42 }, 'and is mutable';
}

{ # RT #130510
my @c[2;2] .= new(:shape(2, 2), <a b>, <c d>);
is @c.perl, Array.new(:shape(2, 2), <a b>, <c d>).perl,
Expand Down

0 comments on commit eae3635

Please sign in to comment.