Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

base tests for importing/exporting constants

  • Loading branch information...
commit 04d2c1de222f56a8c3916b6d9bff774b3a44be31 1 parent e40bbd1
Moritz Lenz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 S11-modules/import.t
6 S11-modules/import.t
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 11;
+plan 13;
# L<S11/Importing without loading>
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.