use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More;
use Sub::Name 'subname';
BEGIN {
sub MODIFY_CODE_ATTRIBUTES {
my ($class, $code) = @_;
- ::ok(!Class::MOP::get_code_info($code), "no name for a coderef that's still compiling");
+ my @info = Class::MOP::get_code_info($code);
+
+ if ( $] >= 5.011 ) {
+ ::is_deeply(\@info, ['Foo', 'foo'], "got a name for a code ref in an attr handler");
+ }
+ else {
+ ::is_deeply(\@info, [], "no name for a coderef that's still compiling");
+ }
return ();
}
sub foo : Bar {}
}
+
+done_testing;