Skip to content

Commit

Permalink
Test Iterator.skip-at-least
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Nov 10, 2016
1 parent 8dbf4c5 commit dc78f3a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S07-iterators/range-iterator.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 106;
plan 107;

{
my $r = (1..5).iterator;
Expand Down Expand Up @@ -176,3 +176,13 @@ subtest 'Iterator.skip-one' => {
is-deeply $r.pull-one, 5, '.pull-one after 2 .skip-one gives correct value';
nok $r.skip-one, '.skip-one returns falsy value when there is nothing to skip';
}

subtest 'Iterator.skip-at-least' => {
plan 4;

my $r = (1..5).iterator;
ok $r.skip-at-least(3), 'skipping 3 values succeeds';
is-deeply $r.pull-one, 4, 'next value after skip is correct';
nok $r.skip-at-least(10), 'skipping more values than we have is falsy';
ok $r.pull-one =:= IterationEnd, 'no more values to pull';
}

0 comments on commit dc78f3a

Please sign in to comment.