Permalink
Browse files

more Range.{roll,pick} tests

  • Loading branch information...
1 parent b896f6d commit 2fae5d6b6da2248a219447e7255e46fdd7c17539 @moritz moritz committed Jan 17, 2012
Showing with 9 additions and 2 deletions.
  1. +5 −1 S32-list/pick.t
  2. +4 −1 S32-list/roll.t
View
6 S32-list/pick.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 35;
+plan 37;
=begin description
@@ -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
View
5 S32-list/roll.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 33;
+plan 35;
=begin description
@@ -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.