This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlunitut, perlreref: Nits
[perl5.git] / t / mro / overload_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 => 7);
16
17{
18 package 밧e텟ʇ;
19 use strict;
20 use warnings;
21 use mro 'c3';
22
23 package Ov에rꪩࡃᛝTeŝṱ;
24 use strict;
25 use warnings;
26 use mro 'c3';
27 use base '밧e텟ʇ';
28 use overload '""' => sub { ref(shift) . " stringified" },
29 fallback => 1;
30
31 sub ネᚹ { bless {} => shift }
32
33 package 읺ҎꀀḮṆᵷꜰ롬ᵕveŔŁoad엗텟ᵵ;
34 use strict;
35 use warnings;
36 use base 'Ov에rꪩࡃᛝTeŝṱ';
37 use mro 'c3';
38}
39
40my $x = 읺ҎꀀḮṆᵷꜰ롬ᵕveŔŁoad엗텟ᵵ->ネᚹ();
bbce3ca6 41object_ok($x, '읺ҎꀀḮṆᵷꜰ롬ᵕveŔŁoad엗텟ᵵ');
204e6232
BF
42
43my $y = Ov에rꪩࡃᛝTeŝṱ->ネᚹ();
bbce3ca6 44object_ok($y, 'Ov에rꪩࡃᛝTeŝṱ');
204e6232
BF
45
46is("$x", '읺ҎꀀḮṆᵷꜰ롬ᵕveŔŁoad엗텟ᵵ stringified', '... got the right value when stringifing');
47is("$y", 'Ov에rꪩࡃᛝTeŝṱ stringified', '... got the right value when stringifing');
48
49ok(($y eq 'Ov에rꪩࡃᛝTeŝṱ stringified'), '... eq was handled correctly');
50
51my $result;
52eval {
53 $result = $x eq '읺ҎꀀḮṆᵷꜰ롬ᵕveŔŁoad엗텟ᵵ stringified'
54};
55ok(!$@, '... this should not throw an exception');
56ok($result, '... and we should get the true value');
57