Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (22 sloc) 0.547 kb
use v6;
use Test;
# test odd things we've seen with modules, packages and namespaces
# the module declaration is executed at compile time,
# so we need to plan early
BEGIN { plan 3 };
module A {
if 1 {
ok 1, '"if" inside a module works';
} else {
ok 0, '"if" inside a module works';
}
my $x = 0;
for <a b c> {
$x++;
}
is $x, 3, 'for loop inside a module works';
sub b { 42 };
is eval('b'), 42,
'eval inside a module looks up subs in the right namespace';
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.