Skip to content

Commit

Permalink
[t/spec] Arity-0 test added.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@29919 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
colomon committed Mar 2, 2010
1 parent 73e6bc8 commit acc5445
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions S03-operators/series-arity0.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use v6;
use Test;

# L<S03/List infix precedence/"the series operator">

plan *;

# some tests without regard to ending

{
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';
}


done_testing;
2 changes: 2 additions & 0 deletions S03-operators/series-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ is (1, { $_ + 2 } ... *).batch(5).join(', '), '1, 3, 5, 7, 9', 'simple series wi

is (1, { 1 / ((1 / $_) + 1) } ... *).batch(5).map({.perl}).join(', '), '1, 1/2, 1/3, 1/4, 1/5', 'tricky series with one item and closure on the LHS';



done_testing;

0 comments on commit acc5445

Please sign in to comment.