6 use Test::More tests => 8;
18 package OverloadingTest;
23 use overload '""' => sub { ref(shift) . " stringified" },
26 sub new { bless {} => shift }
28 package InheritingFromOverloadedTest;
31 use base 'OverloadingTest';
35 Class::C3::initialize();
37 my $x = InheritingFromOverloadedTest->new();
38 isa_ok($x, 'InheritingFromOverloadedTest');
40 my $y = OverloadingTest->new();
41 isa_ok($y, 'OverloadingTest');
43 is("$x", 'InheritingFromOverloadedTest stringified', '... got the right value when stringifing');
44 is("$y", 'OverloadingTest stringified', '... got the right value when stringifing');
46 ok(($y eq 'OverloadingTest stringified'), '... eq was handled correctly');
50 $result = $x eq 'InheritingFromOverloadedTest stringified'
52 ok(!$@, '... this should not throw an exception');
53 ok($result, '... and we should get the true value');
56 #diag Dumper { Class::C3::_dump_MRO_table }