6 use Test::More tests => 2 * 4;
11 package subs::auto::Test;
13 $res{"${_}2"} = __PACKAGE__->can($_) ? 1 : 0 for qw<foo bar baz qux>;
15 BEGIN { $res{foo} = __PACKAGE__->can('foo') ? 1 : 0; }
17 BEGIN { $res{bar} = __PACKAGE__->can('bar') ? 1 : 0; }
19 BEGIN { $res{baz} = __PACKAGE__->can('baz') ? 1 : 0; }
20 BEGIN { $res{qux} = __PACKAGE__->can('qux') ? 1 : 0; }
25 is $res{foo}, 0, 'foo at compile time';
26 is $res{bar}, 1, 'bar at compile time';
27 is $res{baz}, 0, 'baz at compile time';
28 is $res{qux}, 0, 'qux at compile time';
30 is $res{foo2}, 0, 'foo at run time';
31 is $res{bar2}, 1, 'bar at run time';
32 is $res{baz2}, 0, 'baz at run time';
33 is $res{qux2}, 0, 'qux at run time';