Skip to content

Commit

Permalink
add lives-ok test of partially dimensioned view (#821)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucien Grondin <grondilu@outlook.fr>
  • Loading branch information
grondilu and Lucien Grondin committed Sep 8, 2022
1 parent 54e0061 commit 17e785d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion S09-multidim/indexing.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 31;
plan 32;

my @arr := Array.new(:shape(2;2));

Expand All @@ -19,6 +19,8 @@ is @arr[0;1], 'b', 'Can store to multi-dim array with indexer (2)';
is @arr[1;0], 'c', 'Can store to multi-dim array with indexer (3)';
is @arr[1;1], 'd', 'Can store to multi-dim array with indexer (4)';

lives-ok { @arr[*;0] }, 'Partially dimensioned view lives';

dies-ok { @arr[2;0] }, 'Access out of bounds with indexer dies (1)';
dies-ok { @arr[0;2] }, 'Access out of bounds with indexer dies (2)';

Expand Down

0 comments on commit 17e785d

Please sign in to comment.