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

plan 10;

my constant $elems = 200000;
my constant $batch = 16;
my constant @list  = (^$elems).List;

my constant $head   = @list.head;
my constant $head3  = @list.head(3).List;
my constant $headw3 = @list.head(*-3).List;

for 1, ParaSeq.default-degree {
    is-deeply @list.&hyperize($batch, $_).head, $head,
      "head with degree $_";

    my $seq := @list.&hyperize($batch, $_).head(3);
    isa-ok $seq, $_ == 1 ?? Seq !! ParaSeq;
    is-deeply $seq.List, $head3, "head(3) with degree = $_";

    $seq := @list.&hyperize($batch, $_).head(*-3);
    isa-ok $seq, $_ == 1 ?? Seq !! ParaSeq;
    is-deeply $seq.List, $headw3, "head(*-3) with degree = $_";
}

# vim: expandtab shiftwidth=4


