Skip to content

Commit

Permalink
Add tests for non-containerized exports
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Jun 13, 2019
1 parent 63116a9 commit 8a9fee0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions S11-modules/gh2979.t
@@ -0,0 +1,21 @@
use v6;
use Test;

plan 8;

# GH#2979 Symbols are not to be exported in containerized form.

use lib $?FILE.IO.parent(2).add("packages/S11-modules/lib");

use GH2979;

is @foo.VAR.^name, 'Array', 're-exported Array';
is %foo.VAR.^name, 'Hash', 're-exported Hash';
is $foo.VAR.^name, 'Scalar', 're-exported Scalar';
is &foo.VAR.^name, 'Sub', 're-exported Sub';
is @bar.VAR.^name, 'Array', 'exported Array';
is %bar.VAR.^name, 'Hash', 'exported Hash';
is $bar.VAR.^name, 'Scalar', 'exported Scalar';
is &bar.VAR.^name, 'Sub', 'exported Sub';

# vim: ft=perl6 sw=4 expandtabs
7 changes: 7 additions & 0 deletions packages/S11-modules/lib/GH2979-Foo.pm6
@@ -0,0 +1,7 @@
use v6;
unit module GH2979-Foo;

our @foo is export;
our %foo is export;
our $foo is export;
sub foo is export { }
17 changes: 17 additions & 0 deletions packages/S11-modules/lib/GH2979.pm6
@@ -0,0 +1,17 @@
use v6;
use GH2979-Foo;

our @b;
our %b;
our $b;
sub b { }

multi EXPORT {
%(
GH2979-Foo::EXPORT::ALL::,
'@bar' => @b,
'%bar' => %b,
'$bar' => $b,
'&bar' => &b,
)
}

0 comments on commit 8a9fee0

Please sign in to comment.