### ----------------------------------------------------
### -- ParaSeq
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: t/11-reduce.rakutest
### ----------------------------------------------------
use Test;
use ParaSeq;

plan 4;

my constant $elems = 200000;
my constant @list  = (^$elems).map(*.Rat);
my constant $sum   = @list.reduce(* + *);

for 1, ParaSeq.default-degree {
    my $seq := @list.&hyperize(Any, $_);
    isa-ok $seq, $_ == 1 ?? List !! ParaSeq;
    is-deeply $seq.reduce(* + *), $sum, "reduce with degree = $_";
}

# vim: expandtab shiftwidth=4


