2 use warnings FATAL => 'all';
5 # Test that caller() works
10 use Test::More 'no_plan';
12 use Function::Parameters qw(:strict);
15 my($self, $level) = @_;
17 return caller($level);
22 my($self, $level) = @_;
24 return $self->sub_caller($level);
28 method method_caller($level) {
30 return caller($level);
34 method method_caller2($level) {
36 return $self->method_caller($level);
40 my @expected = Foo->sub_caller2(0);
41 my @expected2 = Foo->sub_caller2(1);
44 my @have = Foo->method_caller2(0);
45 my @have2 = Foo->method_caller2(1);
47 $expected[3] = 'Foo::method_caller';
48 $expected2[3] = 'Foo::method_caller2';
50 is_deeply([@have[0..7]], [@expected[0..7]]);
51 is_deeply([@have2[0..7]], [@expected2[0..7]]);
53 # hints and bitmask change and are twitchy so I'm just going to
54 # check that they're there.
56 isnt $have2[8], undef;
58 isnt $have2[9], undef;