-#!perl\r
-# This is based on Class-MOP/t/312_anon_class_leak.t\r
-use strict;\r
-use warnings;\r
-use Test::More;\r
-\r
-BEGIN {\r
- eval "use Test::LeakTrace 0.10;";\r
- plan skip_all => "Test::LeakTrace 0.10 is required for this test" if $@;\r
-}\r
-\r
-plan tests => 6;\r
-\r
-use Mouse ();\r
-{\r
- package MyRole;\r
- use Mouse::Role;\r
-\r
- sub my_role_method{ }\r
-}\r
-\r
-# 5.10.0 has a bug on weaken($hash_ref) which leaks an AV.\r
-my $expected = ( $] == 5.010_000 ? 1 : 0 );\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Class->create_anon_class();\r
-} '<=', $expected, 'create_anon_class()';\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Class->create_anon_class(superclasses => ['Mouse::Meta::Class']);\r
-} '<=', $expected, 'create_anon_class() with superclasses';\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Class->create_anon_class(attributes => [\r
- Mouse::Meta::Attribute->new('foo', is => 'bare'),\r
- ]);\r
-} '<=', $expected, 'create_anon_class() with attributes';\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Class->create_anon_class(roles => [qw(MyRole)]);\r
-} '<=', $expected, 'create_anon_class() with roles';\r
-\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Role->create_anon_role();\r
-} '<=', $expected, 'create_anon_role()';\r
-\r
-leaks_cmp_ok {\r
- Mouse::Meta::Role->create_anon_role(roles => [qw(MyRole)]);\r
-} '<=', $expected, 'create_anon_role() with roles';\r
-\r
+#!perl
+# This is based on Class-MOP/t/312_anon_class_leak.t
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+ eval "use Test::LeakTrace 0.10;";
+ plan skip_all => "Test::LeakTrace 0.10 is required for this test" if $@;
+}
+
+plan tests => 6;
+
+use Mouse ();
+{
+ package MyRole;
+ use Mouse::Role;
+
+ sub my_role_method{ }
+}
+
+# 5.10.0 has a bug on weaken($hash_ref) which leaks an AV.
+my $expected = ( $] == 5.010_000 ? 1 : 0 );
+
+leaks_cmp_ok {
+ Mouse::Meta::Class->create_anon_class();
+} '<=', $expected, 'create_anon_class()';
+
+leaks_cmp_ok {
+ Mouse::Meta::Class->create_anon_class(superclasses => ['Mouse::Meta::Class']);
+} '<=', $expected, 'create_anon_class() with superclasses';
+
+leaks_cmp_ok {
+ Mouse::Meta::Class->create_anon_class(attributes => [
+ Mouse::Meta::Attribute->new('foo', is => 'bare'),
+ ]);
+} '<=', $expected, 'create_anon_class() with attributes';
+
+leaks_cmp_ok {
+ Mouse::Meta::Class->create_anon_class(roles => [qw(MyRole)]);
+} '<=', $expected, 'create_anon_class() with roles';
+
+
+leaks_cmp_ok {
+ Mouse::Meta::Role->create_anon_role();
+} '<=', $expected, 'create_anon_role()';
+
+if($] < 5.010){
+ $expected = 2; # in MRO::Compat::get_linear_isa, maybe harmless
+}
+leaks_cmp_ok {
+ Mouse::Meta::Role->create_anon_role(roles => [qw(MyRole)]);
+} '<=', $expected, 'create_anon_role() with roles';
+