+use strict;
+use warnings;
use Devel::Declare ();
{
shadow(sub (&) { shift });
}
}
-
- sub inject_scope {
- $^H |= 0x120000;
- $^H{DD_METHODHANDLERS} = Scope::Guard->new(sub {
- my $linestr = Devel::Declare::get_linestr;
- my $offset = Devel::Declare::get_linestr_offset;
- substr($linestr, $offset, 0) = ';';
- Devel::Declare::set_linestr($linestr);
- });
- }
}
my ($test_method1, $test_method2, @test_list);
return bless({ @_ }, $class);
};
- method foo (
- $foo
- ) {
+ method foo ($foo) {
return (ref $self).': Foo: '.$foo;
};
}
-use Test::More 'no_plan';
+use Test::More 0.88;
my $o = DeclareTest->new(attr => "value");
is($o->$test_method2('this'), 'DeclareTest2, this', 'anon method with proto ok');
is_deeply([ map { $_->() } @test_list ], [ 1, 2, 3, 4], 'binding ok');
+
+done_testing;