Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
base tests for importing/exporting constants
  • Loading branch information
moritz committed Sep 10, 2012
1 parent e40bbd1 commit 04d2c1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S11-modules/import.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 11;
plan 13;

# L<S11/Importing without loading>

Expand All @@ -10,11 +10,15 @@ plan 11;
module A {
sub Afoo() is export { 'sub A::Afoo' };
sub Abar() { 'sub A::Abar' };
constant pub is export = 42;
constant priv = 23;
}
import A;

is Afoo(), 'sub A::Afoo', 'import imports things marked as "is export"';
dies_ok {eval(q{ Abar() })}, "doesn't import non-exported routines";
is pub, 42, 'can import constants';
dies_ok { eval 'priv' }, 'cannot access non-exported constants';
}

#?rakudo skip 'import plus inline module'
Expand Down

0 comments on commit 04d2c1d

Please sign in to comment.