Skip to content

Commit

Permalink
Test Iterator.skip-at-least-pull-one
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Nov 10, 2016
1 parent dc78f3a commit b03dd14
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 107;
plan 108;

{
my $r = (1..5).iterator;
Expand Down Expand Up @@ -186,3 +186,13 @@ subtest 'Iterator.skip-at-least' => {
nok $r.skip-at-least(10), 'skipping more values than we have is falsy';
ok $r.pull-one =:= IterationEnd, 'no more values to pull';
}

subtest 'Iterator.skip-at-least-pull-one' => {
plan 3;

my $r = (1..6).iterator;
is-deeply $r.skip-at-least-pull-one(3), 4, 'method returns correct value';
is-deeply $r.pull-one, 5, 'value after skip is correct';
ok $r.skip-at-least-pull-one(10) =:= IterationEnd,
'when not enough values to skip, returns IterationEnd';
}

0 comments on commit b03dd14

Please sign in to comment.