Commit | Line | Data |
---|---|---|
1791ba32 | 1 | use strictures 1; |
2 | use Test::More; | |
3 | ||
4 | # Compile-time exceptions, so need stringy eval; hence not Test::Fatal. | |
5 | { | |
6 | local $@; | |
7 | ok not eval q { package XXX; use Moo; use Moo::Role; 1; }; | |
8 | like $@, qr{Cannot import Moo::Role into a Moo class}; | |
9 | } | |
10 | ||
11 | { | |
12 | local $@; | |
13 | ok not eval q { package YYY; use Moo::Role; use Moo; 1; }; | |
14 | like $@, qr{Cannot import Moo into a role}; | |
15 | } | |
16 | ||
17 | done_testing; |