Skip to content

Commit

Permalink
Add tests for RT #81060
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Feb 10, 2015
1 parent cf760b1 commit 7e89188
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S12-class/stubs.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# L<S12/Classes/You can predeclare a stub class>

plan 8;
plan 10;

eval_lives_ok q[ class StubA { ... }; class StubA { method foo { } }; ],
'Can stub a class, and later on declare it';
Expand All @@ -26,4 +26,14 @@ dies_ok { use fatal; (sub { ... }).() }, 'exeucted stub code goes BOOM under fat

eval_dies_ok q[my class StubbedButNotDeclared { ... }], 'stubbing a class but not providing a definition dies';

# RT #81060
{
throws_like { EVAL 'class A { ... }; say A.WHAT' },
X::Package::Stubbed,
message => "The following packages were stubbed but not defined:\n A";
throws_like { EVAL 'class A { ... }; class B is A {}' },
X::Inheritance::NotComposed,
message => "'B' cannot inherit from 'A' because 'A' isn't compose yet (maybe it is stubbed)";
}

# vim: ft=perl6

0 comments on commit 7e89188

Please sign in to comment.