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