Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add "flat"s needed for GLR.
  • Loading branch information
colomon committed Aug 28, 2015
1 parent fd0153c commit ccf062e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions integration/advent2011-day23.t
Expand Up @@ -198,14 +198,13 @@ class Dog {
my @y = 3, 5, 7, 9;
my @z;

@z = map { $_ > 5 ?? ($_) xx 3 !! Nil }, @y;
@z = flat map { $_ > 5 ?? ($_) xx 3 !! Nil }, @y;
is-deeply [@z], [Nil, Nil, 7,7,7, 9,9,9], '@z = map { $_ > 5 ?? ($_) xx 3 !! Nil }, @y';

@z = @y.map: { $_ xx 3 if $_ > 5 };
@z = flat @y.map: { $_ xx 3 if $_ > 5 };
is-deeply @z, [7,7,7, 9,9,9], '@y.map: { $_ xx 3 if $_ > 5 };';

@z = ($_ xx 3 if $_ > 5 for @y);

@z = flat ($_ xx 3 if $_ > 5 for @y);
is-deeply @z, [7,7,7, 9,9,9], '@z = ($_ xx 3 if $_ > 5 for @y);';

# Random integer between 3 and 7 inclusive
Expand Down

0 comments on commit ccf062e

Please sign in to comment.