### ----------------------------------------------------
### -- Sequence::Generator
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: t/01-basic.rakutest
### ----------------------------------------------------
use Test;

use Sequence::Generator;

my @types = < ... ...^ ^... ^...^ >;

plan @types * 3 + 4;

for @types -> $type {

    my $name = "&infix:<$type>";
    ok UNIT::{$name}:exists,
      "is $name imported?";
    nok Sequence::Generator::{$name}:exists,
      "is $name not externally accessible?";
    nok MY::{$name} === CORE::{$name},
      "not the same as the core $name";
}

my $iterator = Sequence::Generator.iterator((1,2,4), 64);
is Seq.new($iterator), '1 2 4 8 16 32 64', '...';
$iterator = Sequence::Generator.iterator((1,2,4), 64, :no-first);
is Seq.new($iterator), '2 4 8 16 32 64', '^...';
$iterator = Sequence::Generator.iterator((1,2,4), 64, :no-last);
is Seq.new($iterator), '1 2 4 8 16 32', '...^';
$iterator = Sequence::Generator.iterator((1,2,4), 64, :no-first, :no-last);
is Seq.new($iterator), '2 4 8 16 32', '^...^';

# vim: expandtab shiftwidth=4


