xref: /openbsd/gnu/usr.bin/perl/t/mro/next_NEXT_utf8.t (revision e5dd7070)
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use NEXT;
6use utf8;
7use open qw( :utf8 :std );
8
9chdir 't' if -d 't';
10require './test.pl';
11plan(tests => 4);
12
13{
14    package ᕘ;
15    use strict;
16    use warnings;
17    use mro 'c3';
18
19    sub fಓ { 'ᕘ::fಓ' }
20
21    package Fᶽ;
22    use strict;
23    use warnings;
24    use mro 'c3';
25    use base 'ᕘ';
26
27    sub fಓ { 'Fᶽ::fಓ => ' . (shift)->next::method }
28
29    package Bᛆ;
30    use strict;
31    use warnings;
32    use mro 'c3';
33    use base 'ᕘ';
34
35    sub fಓ { 'Bᛆ::fಓ => ' . (shift)->next::method }
36
37    package Baᕃ;
38    use strict;
39    use warnings;
40
41    use base 'Bᛆ', 'Fᶽ';
42
43    sub fಓ { 'Baᕃ::fಓ => ' . (shift)->NEXT::fಓ }
44}
45
46is(ᕘ->fಓ, 'ᕘ::fಓ', '... got the right value from ᕘ->fಓ');
47is(Fᶽ->fಓ, 'Fᶽ::fಓ => ᕘ::fಓ', '... got the right value from Fᶽ->fಓ');
48is(Bᛆ->fಓ, 'Bᛆ::fಓ => ᕘ::fಓ', '... got the right value from Bᛆ->fಓ');
49
50is(Baᕃ->fಓ, 'Baᕃ::fಓ => Bᛆ::fಓ => Fᶽ::fಓ => ᕘ::fಓ', '... got the right value using NEXT in a subclass of a C3 class');
51
52