Skip to content

Commit

Permalink
Test reduce metaop of hyper metaop with ...
Browse files Browse the repository at this point in the history
0 and 1 element arrays.

RT #122475
  • Loading branch information
MasterDuke17 committed May 10, 2017
1 parent 42a4bc6 commit 1244df8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S03-metaops/reduce.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 556;
plan 558;

=begin pod
Expand Down Expand Up @@ -164,6 +164,15 @@ lives-ok({my @foo = [1..3] >>+<< [1..3] >>+<< [1..3]},'Sanity Check');

lives-ok({my @foo = [>>+<<] ([1..3],[1..3],[1..3])},'Parse [>>+<<]');

# RT #122475
{
my @a = $(1, 2, 3);
my @b = [>>+<<] @a;
is-deeply @b, @a, 'reduce metaop of hyper metaop works with only one element';
#?rakudo.moar todo 'reduce metaop of hyper metaop works with zero elements'
eval-lives-ok q|my @a; [>>+<<] @a|, 'reduce metaop of hyper metaop works with zero elements';
}

# Check that user defined infix ops work with [...], too.
{
sub infix:<more_than_plus>($a, $b) { $a + $b + 1 }
Expand Down

0 comments on commit 1244df8

Please sign in to comment.