6 BEGIN { chdir 't'; require q(./test.pl); @INC = qw "../lib lib" }
9 use open qw( :utf8 :std );
20 sub new { bless {}, $_[0] }
24 # call the submethod in the direct instance
30 is($foo->ƚ(), 'ᕘ::ƚ', '... got the right return value');
32 # fail calling it from a subclass
43 object_ok($bar, 'Baɾ');
46 # test it working with with Sub::Name
49 skip("Sub::Name is required for this test", 3) if $@;
51 my $m = sub { (shift)->next::method() };
52 Sub::Name::subname('Baɾ::ƚ', $m);
59 my $value = eval { $bar->ƚ() };
60 ok(!$@, '... calling ƚ() succeeded') || diag $@;
61 is($value, 'ᕘ::ƚ', '... got the right return value too');
64 # test it failing without Sub::Name
74 object_ok($baz, 'બʑ');
78 my $m = sub { (shift)->next::method() };
85 ok($@, '... calling ƚ() with next::method failed') || diag $@;
88 # Test with non-existing class (used to segfault)
92 sub fਓ { No::Such::Class->next::can }
96 is($@, '', "->next::can on non-existing package name");