Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for RT #111962.
  • Loading branch information
jnthn committed Apr 28, 2015
1 parent e0193f5 commit 47400f0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions S04-statements/gather.t
Expand Up @@ -2,8 +2,7 @@ use v6;

use Test;

plan 30;

plan 32;

# L<S04/The C<gather> statement prefix/>

Expand Down Expand Up @@ -242,4 +241,19 @@ plan 30;
is $cat, "11 21 2 3", 'bound gather result has up-to-date value while gathering';
}

# RT #111962
{
my @grid = [ Bool.pick xx 5 ] xx 5;
my @neigh = [ ] xx 5;
for ^5 X ^5 -> $i, $j {
@neigh[$i][$j] = gather take-rw @grid[$i + .[0]][$j + .[1]]
if 0 <= $i + .[0] < 5 and 0 <= $j + .[1] < 5
for [-1,-1],[+0,-1],[+1,-1],
[-1,+0], [+1,+0],
[-1,+1],[+0,+1],[+1,+1];
}
ok @grid[1][1] =:= @neigh[2][2][0], "Neighbor is same object as in grid";
ok @neigh[1][1].elems == 8, "There are eight neighbors";
}

# vim: ft=perl6

0 comments on commit 47400f0

Please sign in to comment.