From: Jesse Luehrs Date: Sat, 3 Apr 2010 00:56:15 +0000 (-0500) Subject: more complicated metaclass initialization tests X-Git-Tag: 1.02~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b0ff0b111b55fae95a1249cef77cfe2836f70a2;p=gitmo%2FClass-MOP.git more complicated metaclass initialization tests --- diff --git a/t/041_metaclass_incompatibility.t b/t/041_metaclass_incompatibility.t index f801385..ac16bc1 100644 --- a/t/041_metaclass_incompatibility.t +++ b/t/041_metaclass_incompatibility.t @@ -144,6 +144,39 @@ isa_ok(Class::MOP::class_of('Foo::WithMeta'), 'Foo::Meta::Class'); isa_ok(Class::MOP::class_of('Foo::WithMeta::Sub'), 'Foo::Meta::Class'); isa_ok(Class::MOP::class_of('Foo::WithMeta::Sub::Sub'), 'Foo::Meta::Class'); +Foo::Meta::Class->create('Foo::WithMeta2'); +{ + package Foo::WithMeta2::Sub; + use base 'Foo::WithMeta2'; +} +{ + package Foo::WithMeta2::Sub::Sub; + use base 'Foo::WithMeta2::Sub'; +} +Class::MOP::Class->create( + 'Foo::WithMeta2::Sub::Sub::Sub', + superclasses => ['Foo::WithMeta2::Sub::Sub'] +); + +isa_ok(Class::MOP::class_of('Foo::WithMeta2'), 'Foo::Meta::Class'); +isa_ok(Class::MOP::class_of('Foo::WithMeta2::Sub'), 'Foo::Meta::Class'); +isa_ok(Class::MOP::class_of('Foo::WithMeta2::Sub::Sub'), 'Foo::Meta::Class'); +isa_ok(Class::MOP::class_of('Foo::WithMeta2::Sub::Sub::Sub'), 'Foo::Meta::Class'); + +Class::MOP::Class->create( + 'Foo::Reverse::Sub::Sub', + superclasses => ['Foo::Reverse::Sub'], +); +eval "package Foo::Reverse::Sub; use base 'Foo::Reverse';"; +Foo::Meta::Class->create( + 'Foo::Reverse', +); +isa_ok(Class::MOP::class_of('Foo::Reverse'), 'Foo::Meta::Class'); +{ local $TODO = "no idea how to handle this"; +isa_ok(Class::MOP::class_of('Foo::Reverse::Sub'), 'Foo::Meta::Class'); +isa_ok(Class::MOP::class_of('Foo::Reverse::Sub::Sub'), 'Foo::Meta::Class'); +} + # unsafe fixing... {