Skip to content

Commit

Permalink
Bool.pick
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 15, 2010
1 parent d94794a commit d71f4c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S02-builtin_data_types/bool.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 41;
plan 46;

#L<S12/Enumerations/"Two built-in enumerations are">

Expand Down Expand Up @@ -83,6 +83,17 @@ is(--$bool, Bool::False, 'Decrement of Bool::False produces Bool::False');
is Bool::False.key, 'False', 'Bool::False.key works (is "False")';
}

{
my $x = Bool.pick;
ok ($x === True || $x === False), 'Bool.pick return True or False';
is Bool.pick(*).elems, 2, 'Bool.pick(*) returns two elems';;
my @a = Bool.pick(30, :replace);
ok @a.grep({$_}), 'Bool.pick(30, :replace) contains a True';
ok @a.grep({!$_}), 'Bool.pick(30, :replace) contains a False';
is Bool.pick(*).[^10].elems, 10, 'Bool.pick(*) contains at least 10 elems';

}

isa_ok ('RT71462' ~~ Str), Bool;

done_testing;
Expand Down

0 comments on commit d71f4c3

Please sign in to comment.