Commit | Line | Data |
---|---|---|
204e6232 BF |
1 | #!./perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | use utf8; | |
6 | use open qw( :utf8 :std ); | |
7 | require q(./test.pl); plan(tests => 1); | |
8 | ||
9 | =pod | |
10 | ||
f298f061 SP |
11 | =encoding UTF-8 |
12 | ||
204e6232 BF |
13 | example taken from: L<http://www.opendylan.org/books/drm/Method_Dispatch> |
14 | ||
15 | 옵젳Ṯ | |
16 | ^ | |
17 | | | |
18 | ᓕᵮꡠFᚖᶭ | |
19 | ^ ^ | |
20 | / \ | |
21 | SㄣチenŦ 빞엗ᱞ | |
22 | ^ ^ | |
23 | | | | |
24 | ᕟ텔li겐ț Hʉ만ӫ읻 | |
25 | ^ ^ | |
26 | \ / | |
27 | ቩᓪ찬 | |
28 | ||
29 | define class <SㄣチenŦ> (<ᓕᵮꡠFᚖᶭ>) end class; | |
30 | define class <빞엗ᱞ> (<ᓕᵮꡠFᚖᶭ>) end class; | |
31 | define class <ᕟ텔li겐ț> (<SㄣチenŦ>) end class; | |
32 | define class <Hʉ만ӫ읻> (<빞엗ᱞ>) end class; | |
33 | define class <ቩᓪ찬> (<ᕟ텔li겐ț>, <Hʉ만ӫ읻>) end class; | |
34 | ||
35 | =cut | |
36 | ||
37 | { | |
38 | package 옵젳Ṯ; | |
39 | use mro 'c3'; | |
40 | ||
41 | package ᓕᵮꡠFᚖᶭ; | |
42 | use mro 'c3'; | |
43 | use base '옵젳Ṯ'; | |
44 | ||
45 | package SㄣチenŦ; | |
46 | use mro 'c3'; | |
47 | use base 'ᓕᵮꡠFᚖᶭ'; | |
48 | ||
49 | package 빞엗ᱞ; | |
50 | use mro 'c3'; | |
51 | use base 'ᓕᵮꡠFᚖᶭ'; | |
52 | ||
53 | package ᕟ텔li겐ț; | |
54 | use mro 'c3'; | |
55 | use base 'SㄣチenŦ'; | |
56 | ||
57 | package Hʉ만ӫ읻; | |
58 | use mro 'c3'; | |
59 | use base '빞엗ᱞ'; | |
60 | ||
61 | package ቩᓪ찬; | |
62 | use mro 'c3'; | |
63 | use base ('ᕟ텔li겐ț', 'Hʉ만ӫ읻'); | |
64 | } | |
65 | ||
66 | ok(eq_array( | |
67 | mro::get_linear_isa('ቩᓪ찬'), | |
68 | [ qw(ቩᓪ찬 ᕟ텔li겐ț SㄣチenŦ Hʉ만ӫ읻 빞엗ᱞ ᓕᵮꡠFᚖᶭ 옵젳Ṯ) ] | |
69 | ), '... got the right MRO for the ቩᓪ찬 Dylan Example'); |