This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
TODO tests for reads from a scalar changed to upgraded after open
[perl5.git] / t / mro / inconsistent_c3_utf8.t
CommitLineData
204e6232
BF
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 utf8;
13use open qw( :utf8 :std );
14
15require q(./test.pl); plan(tests => 1);
16
17require mro;
18
19=pod
20
21This example is take from: http://www.python.org/2.3/mro.html
22
23"Serious order disagreement" # From Guido
24class O: pass
25class X(O): pass
26class Y(O): pass
27class A(X,Y): pass
28class B(Y,X): pass
29try:
30 class Z(A,B): pass #creates Z(A,B) in Python 2.2
31except TypeError:
32 pass # Z(A,B) cannot be created in Python 2.3
33
34=cut
35
36{
37 package ẋ;
38
39 package Ƴ;
40
41 package ẋƳ;
42 our @ISA = ('ẋ', 'Ƴ');
43
44 package Ƴẋ;
45 our @ISA = ('Ƴ', 'ẋ');
46
47 package Ȥ;
48 our @ISA = ('ẋƳ', 'Ƴẋ');
49}
50
51eval { mro::get_linear_isa('Ȥ', 'c3') };
52like($@, qr/^Inconsistent /, '... got the right error with an inconsistent hierarchy');