Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
clean up enum tests a big, refudge for rakudo
  • Loading branch information
moritz committed Mar 30, 2012
1 parent 903dffc commit 931b743
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions S12-enums/thorough.t
Expand Up @@ -15,10 +15,8 @@ Enum tests from L<S12/Enumerations>
# L<S12/Enumerations/keys are specified as a parenthesized list>
enum day <Sun Mon Tue Wed Thu Fri Sat>;

ok day ne "", 'enum itself stringififes';
#?rakudo skip 'regression'
#?niecza todo
ok day.WHAT, 'enum.WHAT returned a value';
is day.gist, 'day()', 'enum itself stringififes';
ok day.WHAT === day, 'enum.WHAT returned a value';
ok day.perl, 'enum.perl returned a value';

sub test_stuff($x) {
Expand All @@ -36,14 +34,12 @@ sub test_stuff($x) {
ok $x.does(Tue), ".does worked correctly ($x-1)";
#?niecza skip 'No candidates for dispatch to infix:<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.WHAT === day, '$obj.Tue.WHAT returns the proper type object';
ok $x.Tue.perl, '$obj.Tue.perl returns a true valuee';
}

#?rakudo skip 'NYI'
{
my $x = 1;
is $x, 1, "basic sanity (1)";
Expand Down Expand Up @@ -92,12 +88,11 @@ sub test_stuff($x) {
ok True.perl ~~/^ 'Bool::True'/, 'True.perl';
ok Bool::True.perl ~~/^ 'Bool::True'/, 'Bool::True.perl';

#?rakudo skip 'enum name as type constraint'
{
enum Negation << :isnt<isnt> :arent<arent> :amnot<amnot> :aint<aint> >>;
my Negation $foo;
#?rakudo todo 'Null PMC Access in invoke()'
lives_ok { $foo = Negation::isnt }, 'simple assignment from enum';
#?rakudo skip 'Null PMC Access in invoke()'
is $foo, Negation::isnt, 'assignment from enum works';
}

Expand All @@ -110,7 +105,6 @@ ok Bool::True.perl ~~/^ 'Bool::True'/, 'Bool::True.perl';
# RT #65658
{
enum RT65658 <Todo Bug Feature Ticket>;
#?rakudo 2 skip 'RT 65658'
is RT65658(2), RT65658::Feature, 'can index enum by number';
is RT65658((Todo + 3.2).Int), RT65658::Ticket, 'enum and math and index';
}
Expand Down

0 comments on commit 931b743

Please sign in to comment.