1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
#!./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 텟Ṱ::Ḵ');
|