fix ::DBI::Replicated::all_storages
[dbsrgits/DBIx-Class.git] / t / 04dont_break_c3.t
CommitLineData
e4c24739 1#!/usr/bin/perl -w
2#Simon Ilyushchenko, 12/05/05
3#Testing the case when we try to inject into @ISA a class that's already a parent of the target class.
4
5use strict;
6use Test::More tests => 2;
4f507947 7use MRO::Compat;
e4c24739 8
9{
10package AAA;
11
12use base "DBIx::Class::Core";
13
14package BBB;
15
16use base 'AAA';
17
18#Injecting a direct parent.
19__PACKAGE__->inject_base( __PACKAGE__, 'AAA' );
20
21
22package CCC;
23
24use base 'AAA';
25
26#Injecting an indirect parent.
27__PACKAGE__->inject_base( __PACKAGE__, 'DBIx::Class::Core' );
28}
29
4f507947 30eval { mro::get_linear_isa('BBB'); };
e4c24739 31ok (! $@, "Correctly skipped injecting a direct parent of class BBB");
32
4f507947 33eval { mro::get_linear_isa('CCC'); };
e4c24739 34ok (! $@, "Correctly skipped injecting an indirect parent of class BBB");