Skip to content

Commit

Permalink
more Range.{roll,pick} tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jan 17, 2012
1 parent b896f6d commit 2fae5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion S32-list/pick.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 35;
plan 37;

=begin description
Expand Down Expand Up @@ -122,4 +122,8 @@ is (<a b c d>.pick(*).sort).Str, 'a b c d', 'pick(*) returns all the items in th
ok (so 1 < all(%seen.keys) < 1_000_000), '... and all the elements are in range';
}

is (1..^2).pick, 1, 'pick on 1-elem range';

ok ('a'..'z').pick ~~ /\w/, 'Range.pick on non-Int range';

# vim: ft=perl6
5 changes: 4 additions & 1 deletion S32-list/roll.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 33;
plan 35;

=begin description
Expand Down Expand Up @@ -103,4 +103,7 @@ is (0, 1).roll(*).[^10].elems, 10, '.roll(*) returns at least ten elements';
ok (so 1 < all(@matches) < 1_000_000), 'all the elems are in range';
}

is (1..^2).roll, 1, '1-elem Range roll';
ok ('a' .. 'z').roll ~~ /\w/, 'Str-Range roll';

# vim: ft=perl6

0 comments on commit 2fae5d6

Please sign in to comment.