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

plan 9;

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

for 1, ParaSeq.default-degree {
    is-deeply @list.&hyperize($batch, $_).elems, $elems,
      ".elems with degree $_";
    is-deeply @list.&hyperize($batch, $_).end,   $end,
      ".end with degree $_";
    is-deeply @list.&hyperize($batch, $_).is-lazy, False,
      ".is-lazy with degree $_";
}

fails-like { (^Inf).&hyperize.elems }, X::Cannot::Lazy,
  action => '.elems';
todo 'Fixed in Rakudo 2024.06';
fails-like { (^Inf).&hyperize.end   }, X::Cannot::Lazy,
  action => '.end';
is-deeply (^Inf).&hyperize.is-lazy, True, '^Inf is lazy';

# vim: expandtab shiftwidth=4


