This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Small optimisations, by Brandon Black
[perl5.git] / t / mro / basic_04_c3.t
CommitLineData
e1a479c5
BB
1#!./perl
2
3use strict;
4use warnings;
5BEGIN {
6 unless (-d 'blib') {
7 chdir 't' if -d 't';
8 @INC = '../lib';
9 }
10}
11
12use Test::More tests => 1;
13
14=pod
15
16From the parrot test t/pmc/object-meths.t
17
18 A B A E
19 \ / \ /
20 C D
21 \ /
22 \ /
23 F
24
25=cut
26
27{
28 package t::lib::A; use mro 'c3';
29 package t::lib::B; use mro 'c3';
30 package t::lib::E; use mro 'c3';
31 package t::lib::C; use mro 'c3'; use base ('t::lib::A', 't::lib::B');
32 package t::lib::D; use mro 'c3'; use base ('t::lib::A', 't::lib::E');
33 package t::lib::F; use mro 'c3'; use base ('t::lib::C', 't::lib::D');
34}
35
36is_deeply(
37 mro::get_linear_isa('t::lib::F'),
38 [ qw(t::lib::F t::lib::C t::lib::D t::lib::A t::lib::B t::lib::E) ],
39 '... got the right MRO for t::lib::F');
40