#!./perl use strict; use warnings; use utf8; use open qw( :utf8 :std ); require q(./test.pl); plan(tests => 11); =pod This example is taken from: http://rt.cpan.org/Public/Bug/Display.html?id=20879 --- --- --- Level 5 8 | A | 9 | B | A | C | (More General) --- --- --- V \ | / | \ | / | \ | / | \ | / | --- | Level 4 7 | D | | --- | / \ | / \ | --- --- | Level 3 4 | G | 6 | E | | --- --- | | | | | | | --- --- | Level 2 3 | H | 5 | F | | --- --- | \ / | | \ / | | \ | | / \ | | / \ | | --- --- | Level 1 1 | J | 2 | I | | --- --- | \ / | \ / | --- v Level 0 0 | K | (More Specialized) --- 0123456789A KJIHGFEDABC =cut { package 텟Ṱ::ᐊ; use mro 'dfs'; package 텟Ṱ::ḅ; use mro 'dfs'; package 텟Ṱ::ȼ; use mro 'dfs'; package 텟Ṱ::Ḏ; use mro 'dfs'; use base qw/텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ/; package 텟Ṱ::Ӭ; use mro 'dfs'; use base qw/텟Ṱ::Ḏ/; package 텟Ṱ::Ḟ; use mro 'dfs'; use base qw/텟Ṱ::Ӭ/; package 텟Ṱ::ḡ; use mro 'dfs'; use base qw/텟Ṱ::Ḏ/; package 텟Ṱ::Ḣ; use mro 'dfs'; use base qw/텟Ṱ::ḡ/; package 텟Ṱ::ᶦ; use mro 'dfs'; use base qw/텟Ṱ::Ḣ 텟Ṱ::Ḟ/; package 텟Ṱ::J; use mro 'dfs'; use base qw/텟Ṱ::Ḟ/; package 텟Ṱ::Ḵ; use mro 'dfs'; use base qw/텟Ṱ::J 텟Ṱ::ᶦ/; } ok(eq_array( mro::get_linear_isa('텟Ṱ::ᐊ'), [ qw(텟Ṱ::ᐊ) ] ), '... got the right DFS merge order for 텟Ṱ::ᐊ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::ḅ'), [ qw(텟Ṱ::ḅ) ] ), '... got the right DFS merge order for 텟Ṱ::ḅ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::ȼ'), [ qw(텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::ȼ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::Ḏ'), [ qw(텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::Ḏ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::Ӭ'), [ qw(텟Ṱ::Ӭ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::Ӭ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::Ḟ'), [ qw(텟Ṱ::Ḟ 텟Ṱ::Ӭ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::Ḟ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::ḡ'), [ qw(텟Ṱ::ḡ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::ḡ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::Ḣ'), [ qw(텟Ṱ::Ḣ 텟Ṱ::ḡ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::Ḣ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::ᶦ'), [ qw(텟Ṱ::ᶦ 텟Ṱ::Ḣ 텟Ṱ::ḡ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ 텟Ṱ::Ḟ 텟Ṱ::Ӭ) ] ), '... got the right DFS merge order for 텟Ṱ::ᶦ'); ok(eq_array( mro::get_linear_isa('텟Ṱ::J'), [ qw(텟Ṱ::J 텟Ṱ::Ḟ 텟Ṱ::Ӭ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ) ] ), '... got the right DFS merge order for 텟Ṱ::J'); ok(eq_array( mro::get_linear_isa('텟Ṱ::Ḵ'), [ qw(텟Ṱ::Ḵ 텟Ṱ::J 텟Ṱ::Ḟ 텟Ṱ::Ӭ 텟Ṱ::Ḏ 텟Ṱ::ᐊ 텟Ṱ::ḅ 텟Ṱ::ȼ 텟Ṱ::ᶦ 텟Ṱ::Ḣ 텟Ṱ::ḡ) ] ), '... got the right DFS merge order for 텟Ṱ::Ḵ');