# make sure we are tracking metaclasses correctly
-my $CLASS_MOP_CLASS_IMMUTABLE_CLASS
- = 'Class::MOP::Class::__ANON__::SERIAL::1';
+my @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
+ = map { 'Class::MOP::Class::__ANON__::SERIAL::' . $_ } 1..11;
my %METAS = (
'Class::MOP::Attribute' => Class::MOP::Attribute->meta,
{Class::MOP::get_all_metaclasses},
{
%METAS,
- $CLASS_MOP_CLASS_IMMUTABLE_CLASS =>
- $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta
+ map { $_ => $_->meta } @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
},
'... got all the metaclasses'
);
[
Class::MOP::Attribute->meta,
Class::MOP::Class->meta,
- $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta,
+ ( map { $_->meta } sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ),
Class::MOP::Instance->meta,
Class::MOP::Method->meta,
Class::MOP::Method::Accessor->meta,
Class::MOP::Module
Class::MOP::Object
Class::MOP::Package
- /, $CLASS_MOP_CLASS_IMMUTABLE_CLASS
+ /, @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
],
'... got all the metaclass names'
);
. $Class::MOP::Attribute::VERSION
. "-cpan:STEVAN",
"Class::MOP::Class-" . $Class::MOP::Class::VERSION . "-cpan:STEVAN",
- $CLASS_MOP_CLASS_IMMUTABLE_CLASS,
+ ( sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ),
"Class::MOP::Instance-"
. $Class::MOP::Instance::VERSION
. "-cpan:STEVAN",
{
my $meta = Baz->meta;
ok($meta->is_mutable, '... Baz is mutable');
- is(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta), 'Foo and Bar immutable metaclasses match');
+ isnt(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta),
+ 'Foo and Bar immutable metaclasses do not match');
is(Scalar::Util::blessed($meta), 'MyMetaClass', 'Baz->meta blessed as MyMetaClass');
ok(Baz->can('mymetaclass_attributes'), '... Baz can do method before immutable');
ok($meta->can('mymetaclass_attributes'), '... meta can do method before immutable');