Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a couple of tests, unfudge for niecza.

  • Loading branch information...
commit 0ced9862ce1634618e04e7b358f65418cfb32b14 1 parent 399972e
@colomon colomon authored
Showing with 12 additions and 5 deletions.
  1. +0 −1  S12-enums/basic.t
  2. +2 −3 S32-list/pick.t
  3. +10 −1 S32-list/roll.t
View
1  S12-enums/basic.t
@@ -94,7 +94,6 @@ dies_ok({ my Color $c3 = "for the fail" }, 'enum as a type enforces checks');
ok ?(Color.pick == any(Color::white, Color::gray, Color::black)),
'.pick on enums';
- #?niecza todo 'picking multiple elements from an enum'
ok Color.pick(2) == 2, '.pick(2) on enums';
}
View
5 S32-list/pick.t
@@ -89,12 +89,11 @@ is (<a b c d>.pick(*).sort).Str, 'a b c d', 'pick(*) returns all the items in th
}
# enums + pick
-#?niecza todo "pick(*) NYI"
{
- is Bool.pick(*).elems, 2, 'Bool.pick works';
+ is Bool.pick(*).grep(Bool).elems, 2, 'Bool.pick works';
enum A <b c d>;
- is A.pick(*).elems, 3, 'RandomEnum.pick works';
+ is A.pick(*).grep(A).elems, 3, 'RandomEnum.pick works';
}
# vim: ft=perl6
View
11 S32-list/roll.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 23;
+plan 25;
=begin description
@@ -72,4 +72,13 @@ is (0, 1).roll(*).[^10].elems, 10, '.roll(*) returns at least ten elements';
is roll("25", @a).elems, 25, "roll works Str arguments";
}
+# enums + roll
+{
+ is Bool.roll(3).grep(Bool).elems, 3, 'Bool.roll works';
+
+ enum A <b c d>;
+ is A.roll(4).grep(A).elems, 4, 'RandomEnum.roll works';
+}
+
+
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.