This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: implement flock() emulation
[perl5.git] / t / mro / inconsistent_c3_utf8.t
CommitLineData
204e6232
BF
1#!./perl
2
204e6232
BF
3BEGIN {
4 unless (-d 'blib') {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7 }
8}
9
0b1b7115
JH
10use strict;
11use warnings;
12
204e6232
BF
13use utf8;
14use open qw( :utf8 :std );
15
16require q(./test.pl); plan(tests => 1);
17
18require mro;
19
20=pod
21
22This example is take from: http://www.python.org/2.3/mro.html
23
24"Serious order disagreement" # From Guido
25class O: pass
26class X(O): pass
27class Y(O): pass
28class A(X,Y): pass
29class B(Y,X): pass
30try:
31 class Z(A,B): pass #creates Z(A,B) in Python 2.2
32except TypeError:
33 pass # Z(A,B) cannot be created in Python 2.3
34
35=cut
36
37{
38 package ẋ;
39
40 package Ƴ;
41
42 package ẋƳ;
43 our @ISA = ('ẋ', 'Ƴ');
44
45 package Ƴẋ;
46 our @ISA = ('Ƴ', 'ẋ');
47
48 package Ȥ;
49 our @ISA = ('ẋƳ', 'Ƴẋ');
50}
51
52eval { mro::get_linear_isa('Ȥ', 'c3') };
53like($@, qr/^Inconsistent /, '... got the right error with an inconsistent hierarchy');