Skip to content

Commit

Permalink
fduge constant.t for rakudo
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 4, 2011
1 parent 092ab84 commit b35368d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S04-declarations/constant.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ use Test;
eval_dies_ok 'foo2 == 42', 'constants are lexically scoped';
}

#?rakudo skip 'constants as type constraints'
{
constant foo3 = 42;
lives_ok { my foo3 $x = 42 }, 'constant can be used as a type constraint';
dies_ok { my foo3 $x = 43 }, 'constant used as a type constraint enforces';
dies_ok { my foo3 $x = 42; $x =43 }, 'constant used as a type constraint enforces';
}

#?rakudo skip 'non-literal constants'
{
my $ok;

Expand Down Expand Up @@ -87,6 +89,7 @@ use Test;
ok $ok, "declaring a constant in terms of COMPILING constant works";
}

#?rakudo skip 'constant hashes'
{
my $ok;

Expand All @@ -108,6 +111,7 @@ use Test;
ok $ok, "declaring a constant in terms of COMPILING hash constant works";
}

#?rakudo skip 'array constants'
{
my $ok;

Expand All @@ -129,6 +133,7 @@ use Test;
ok $ok, "declaring a constant in terms of COMPILING hash constant works";
}

#?rakudo skip 'typed constants'
{
my $ok;

Expand Down Expand Up @@ -229,7 +234,6 @@ use Test;
is $x, 64522, 'constant after += has not changed';

sub con { 64522 }
#?rakudo todo '++constant_returning_sub()'
dies_ok { ++con }, "constant-returning sub won't increment";
is con, 64522, 'constant-returning sub after ++ has not changed';
}
Expand Down

0 comments on commit b35368d

Please sign in to comment.