X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F21_C3_with_overload.t;h=80b45a8f55294f6a37076120c4c29740c81b5b4f;hb=ed5a217268b1f8b54cc4fff97d8e8a2a0f17f00b;hp=e61256878514911895bee435799089b49747a15a;hpb=680100b1744c65ae1a1dc2da8522731aa197d75b;p=gitmo%2FClass-C3.git diff --git a/t/21_C3_with_overload.t b/t/21_C3_with_overload.t index e612568..80b45a8 100644 --- a/t/21_C3_with_overload.t +++ b/t/21_C3_with_overload.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 9; BEGIN { use_ok('Class::C3'); @@ -30,8 +30,24 @@ BEGIN { use warnings; use base 'OverloadingTest'; use Class::C3; + + package BaseTwo; + use overload ( + q{fallback} => 1, + q{""} => 'str', ### character + ); + sub str { + return 'BaseTwo str'; + } + + package OverloadInheritTwo; + use Class::C3; + use base qw/BaseTwo/; + } +Class::C3::initialize(); + my $x = InheritingFromOverloadedTest->new(); isa_ok($x, 'InheritingFromOverloadedTest'); @@ -50,5 +66,10 @@ eval { ok(!$@, '... this should not throw an exception'); ok($result, '... and we should get the true value'); +eval { + my $obj = bless {}, 'OverloadInheritTwo'; +}; +is($@, '', "Overloading to method name string"); + #use Data::Dumper; #diag Dumper { Class::C3::_dump_MRO_table }