Permalink
Browse files

[t/spec] Tweak and mostly fudge S12-enums/thorough.t.

git-svn-id: http://svn.pugscode.org/pugs@26599 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent d89c1bb commit 7810f3e54cf5d149f9f68706e86bbfce67d729cf jnthn committed May 1, 2009
Showing with 25 additions and 18 deletions.
  1. +25 −18 S12-enums/thorough.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 67;
+plan 63;
=begin description
@@ -15,35 +15,39 @@ Enum tests from L<S12/Enums>
enum day <Sun Mon Tue Wed Thu Fri Sat>;
ok day.WHAT, 'enum.WHAT returned a value';
+#?rakudo todo '.perl on an enum itself'
ok day.perl, 'enum.perl returned a value';
-#?DOES 14
sub test_stuff($x) {
- ok not $x does Wed, "basic enum mixing worked ($x-2)";
- is $x.day, 3, "automatically created accessor worked ($x)";
- is day::Tue, 3, "enum provided a correct mapping ($x)";
- ok $x ~~ day, "smartmatch worked correctly ($x-1)";
- ok $x ~~ Tue, "smartmatch worked correctly ($x-2)";
- ok $x ~~ day::Tue, "smartmatch worked correctly ($x-3)";
- ok $x !~~ Wed, "smartmatch worked correctly ($x-4)";
- ok $x.does(Tue), ".does worked correctly ($x-1)";
- ok $x.does(day), ".does worked correctly ($x-2)";
- is $x.day, 3, ".day worked correctly ($x)";
- ok Tue($x), "Tue() worked correctly ($x)";
- ok $x.Tue, ".Tue() worked correctly ($x)";
- ok $x.Tue.WHAT, '$obj.Tue.WHAT returns a true valuee';
- ok $x.Tue.perl, '$obj.Tue.perl returns a true valuee';
+ ok $x.does(day::Tue), "basic enum mixing worked ($x-2)";
+ is $x.day, 2, "automatically created accessor worked ($x)";
+ is day::Tue, 2, "enum provided a correct mapping ($x)";
+ ok $x ~~ day, "smartmatch worked correctly ($x-1)";
+ #?rakudo 2 todo 'smartmatch on enum elements'
+ ok $x ~~ Tue, "smartmatch worked correctly ($x-2)";
+ ok $x ~~ day::Tue, "smartmatch worked correctly ($x-3)";
+ ok $x !~~ Wed, "smartmatch worked correctly ($x-4)";
+ ok $x.does(Tue), ".does worked correctly ($x-1)";
+ #?rakudo todo '.does'
+ ok $x.does(day), ".does worked correctly ($x-2)";
+ #?rakudo skip 'EnumValue($x)'
+ ok Tue($x), "Tue() worked correctly ($x)";
+ ok $x.Tue, ".Tue() worked correctly ($x)";
+ #?rakudo skip 'unknown bug'
+ ok $x.Tue.WHAT, '$obj.Tue.WHAT returns a true valuee';
+ ok $x.Tue.perl, '$obj.Tue.perl returns a true valuee';
}
{
my $x = 1;
is $x, 1, "basic sanity (1)";
# L<S12/Enums/has the right semantics mixed in:>
- ok $x does Tue, "basic enum mixing worked (1-1)";
- $x does Tue;
+ ok $x does day(Tue), "basic enum mixing worked (1-1)";
test_stuff($x);
}
+#?DOES 15
+#?rakudo skip 'does day<tue> - but is this even valid?'
{
my $x = 2;
is $x, 2, "basic sanity (2)";
@@ -52,6 +56,7 @@ sub test_stuff($x) {
test_stuff($x);
}
+#?rakudo skip 'does day::Tue'
{
my $x = 3;
is $x, 3, "basic sanity (3)";
@@ -60,6 +65,8 @@ sub test_stuff($x) {
test_stuff($x);
}
+#?DOES 16
+#?rakudo skip 'does &day::("Tue")'
{
my $x = 4;
is $x, 4, "basic sanity (4)";

0 comments on commit 7810f3e

Please sign in to comment.