also allow suppressing the meta method during CMOP::Class->create
[gitmo/Class-MOP.git] / t / 303_RT_39001_fix.t
CommitLineData
7ae55cf7 1use strict;
2use warnings;
86a4d873 3use Test::More;
7ae55cf7 4use Test::Exception;
5
efd3d14c 6use Class::MOP;
7ae55cf7 7
8=pod
9
10This tests a bug sent via RT #39001
11
12=cut
13
14{
15 package Foo;
16 use metaclass;
17}
18
19throws_ok {
20 Foo->meta->superclasses('Foo');
21} qr/^Recursive inheritance detected/, "error occurs when extending oneself";
22
23{
24 package Bar;
25 use metaclass;
26}
27
28lives_ok {
29 Foo->meta->superclasses('Bar');
30} "regular subclass";
31
32throws_ok {
33 Bar->meta->superclasses('Foo');
34} qr/^Recursive inheritance detected/, "error occurs when Bar extends Foo, when Foo is a Bar";
35
86a4d873 36done_testing;