BEGIN {
$^P &= ~0x200; # Don't munger anonymous sub names
if ( eval 'use Sub::Name qw(subname); 1;' ) {
- plan tests => 5;
+ plan tests => 6;
}
else {
plan skip_all => 'These tests require Sub::Name';
require Class::MOP::Method;
code_name_is( \&Class::MOP::Method::name, "Class::MOP::Method", "name" );
+{
+ package Foo;
+
+ sub MODIFY_CODE_ATTRIBUTES {
+ my ($class, $code) = @_;
+ ::ok(!Class::MOP::get_code_info($code), "no name for a coderef that's still compiling");
+ return ();
+ }
+
+ sub foo : Bar {}
+}