Skip to content

Commit

Permalink
Merge pull request #251 from LLFourn/require-issues
Browse files Browse the repository at this point in the history
Tests for latest require issues
  • Loading branch information
lizmat committed Mar 7, 2017
2 parents f2afb87 + 12b4738 commit f5d9966
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions S11-modules/lib/Cool/Beans.pm6
@@ -0,0 +1 @@
class Cool::Beans { }
3 changes: 3 additions & 0 deletions S11-modules/lib/Cool/Cat.pm6
@@ -0,0 +1,3 @@
class Cool::Cat {
method meow { 'meow' }
}
3 changes: 3 additions & 0 deletions S11-modules/lib/Cool/Cat/Goes/Splat.pm6
@@ -0,0 +1,3 @@
class Cool::Cat::Goes::Splat {
method moew { 'splat' }
}
17 changes: 16 additions & 1 deletion S11-modules/require.t
Expand Up @@ -6,7 +6,7 @@ use MONKEY-SEE-NO-EVAL;

my $required-Test = (require Test <&plan &is &lives-ok &skip &todo
&nok &throws-like &eval-lives-ok &ok>);
plan 27;
plan 32;

# RT #126100
{
Expand Down Expand Up @@ -118,4 +118,19 @@ nok ::('&bar'),"bar didn't leak";
is $res,::('Cool::Utils'), 'Cool::Utils was returned';
}

{
require Cool::Utils;
{
require Cool::Beans;
require Cool::Cat;
require Cool::Cat::Goes::Splat;
for <Utils Beans Cat>.kv -> $i,$sym {
ok Cool::{$sym}:exists,'{$i+1}. multiple requires with top level package already defined';
}
is Cool::Cat.new.meow,'meow','class in required package';
is Cool::Cat::Goes::<Splat>.new.meow,'splat',"class in long required package name";
}
}


# vim: ft=perl6

0 comments on commit f5d9966

Please sign in to comment.