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