Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace .munch(N) with [^N]
  • Loading branch information
moritz committed Aug 26, 2015
1 parent 6f8b7a3 commit e9f0300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions S03-sequence/arity0.t
Expand Up @@ -16,7 +16,7 @@ plan 13;
# Test with exact limit
#?niecza skip 'Unable to resolve method munch in class List'
{
my @rolls = ({ (1..2).pick } ... 2).munch(100);
my @rolls = ({ (1..2).pick } ... 2)[^100];
ok +@rolls > 0, 'the sequence had at least one element...';
ok +@rolls < 100, '... and the sequence terminated';
is @rolls.grep(Int).elems, +@rolls, 'all the rolls are Ints';
Expand All @@ -27,15 +27,15 @@ plan 13;
# Test with limit between possible values
#?niecza skip 'Unable to resolve method munch in class List'
{
my @rolls = ({ (1..2).pick } ... 1.5).munch(100);
my @rolls = ({ (1..2).pick } ... 1.5)[^100];
ok +@rolls == 100, 'the sequence is infinite...';
is @rolls.grep(Int).elems, +@rolls, 'all the rolls are Ints';
}

# Test with limit that cannot be hit
#?niecza skip 'Unable to resolve method munch in class List'
{
my @rolls = ({ (1..6).pick } ... 7).munch(40);
my @rolls = ({ (1..6).pick } ... 7)[^40];
is +@rolls, 40, 'Got the number of rolls we asked for';
is @rolls.grep(Int).elems, 40, 'all the rolls are Ints';
is @rolls.grep(1..6).elems, 40, 'all the rolls are in the Range 1..6';
Expand Down

0 comments on commit e9f0300

Please sign in to comment.