|
2 | 2 |
|
3 | 3 | use Test;
|
4 | 4 |
|
5 |
| -plan 47; |
| 5 | +plan 57; |
6 | 6 |
|
7 | 7 | =begin description
|
8 | 8 |
|
@@ -174,4 +174,19 @@ ok ('a'..'z').pick ~~ /\w/, 'Range.pick on non-Int range';
|
174 | 174 | #?pugs skip 'hogs memory'
|
175 | 175 | nok ([==] (^2**64).roll(10).map(* +& 15)), 'Range.pick has enough entropy';
|
176 | 176 |
|
| 177 | +# sanity on Enums |
| 178 | +{ |
| 179 | + is Order.pick, any(Less,Same,More), 'simple pick on Enum type works'; |
| 180 | + is Order.pick(1), any(Less,Same,More), 'one pick on Enum type works'; |
| 181 | + is sort(Order.pick(*)), (Less,Same,More), 'all pick on Enum type works'; |
| 182 | + is sort(Order.pick(4)), (Less,Same,More), 'too many pick on Enum type works'; |
| 183 | + is Order.pick(0), (), 'zero pick on Enum type works'; |
| 184 | + |
| 185 | + is Less.pick, Less, 'simple pick on Enum is sane'; |
| 186 | + is Same.pick(1), Same, 'one pick on Enum is sane'; |
| 187 | + is More.pick(*), More, 'all pick on Enum is sane'; |
| 188 | + is Less.pick(4), Less, 'too many pick on Enum is sane'; |
| 189 | + is More.pick(0), (), 'zero pick on Enum is sane'; |
| 190 | +} |
| 191 | + |
177 | 192 | # vim: ft=perl6
|
0 commit comments