Skip to content

Commit

Permalink
[t/spec] Comments explaining what the previous tests were and a new t…
Browse files Browse the repository at this point in the history
…est, with a limit that will never be triggered.

git-svn-id: http://svn.pugscode.org/pugs@29922 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
colomon committed Mar 3, 2010
1 parent a5c64f1 commit bdc5411
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions S03-operators/series-arity0.t
Expand Up @@ -5,15 +5,15 @@ use Test;

plan *;

# some tests without regard to ending

# Test with Whatever limit
{
my @rolls = ({ (1..6).pick } ... *).batch(20);
is +@rolls, 20, 'Got the number of rolls we asked for';
is @rolls.grep(Int).elems, 20, 'all the rolls are Ints';
is @rolls.grep(1..6).elems, 20, 'all the rolls are in the Range 1..6';
}

# Test with exact limit
{
my @rolls = ({ (1..2).pick } ... 2).batch(100);
ok +@rolls > 0, 'the series had at least one element...';
Expand All @@ -23,6 +23,7 @@ plan *;
is @rolls[@rolls.elems - 1], 2, '...and it was the last roll';
}

# Test with limit between possible values
{
my @rolls = ({ (1..2).pick } ... 1.5).batch(100);
ok +@rolls > 0, 'the series had at least one element...';
Expand All @@ -31,5 +32,13 @@ plan *;
is @rolls.grep(@rolls[0]).elems, +@rolls, 'All the rolls are the same';
}

# Test with limit that cannot be hit
{
my @rolls = ({ (1..6).pick } ... 7).batch(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';
}


done_testing;

0 comments on commit bdc5411

Please sign in to comment.