Skip to content

Commit

Permalink
Fix tests (constants are our, so you can't declare the same one twice…
Browse files Browse the repository at this point in the history
…) and unfudge.
  • Loading branch information
colomon committed Dec 24, 2011
1 parent 9548c68 commit 01a2c6d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions S04-declarations/constant.t
Expand Up @@ -10,27 +10,25 @@ use Test;
{
constant foo = 42;

#?niecza todo "Errr... what?!?!"
ok foo == 42, "declaring a sigilless constant using 'constant' works";
dies_ok { foo = 3 }, "can't reassign to a sigil-less constant";
}

{
# RT #69522
sub foo { "OH NOES" };
constant foo = 5;
is foo, 5, 'bare constant wins against sub of the same name';
sub foo0 { "OH NOES" };
constant foo0 = 5;
is foo0, 5, 'bare constant wins against sub of the same name';
#?niecza skip 'Unable to resolve method postcircumfix:<( )> in class Int'
is foo(), 'OH NOES', '... but parens always indicate a sub call';
is foo0(), 'OH NOES', '... but parens always indicate a sub call';
}

{
my $ok;

constant $bar = 42;
#?niecza todo "Errr... what?!?!"
ok $bar == 42, "declaring a constant with a sigil using 'constant' works";
dies_ok { $bar = 2 }, "Can't reassign to a sigiled constant";
constant $bar0 = 42;
ok $bar0 == 42, "declaring a constant with a sigil using 'constant' works";
dies_ok { $bar0 = 2 }, "Can't reassign to a sigiled constant";
}

# RT #69740
Expand Down

0 comments on commit 01a2c6d

Please sign in to comment.