2 use warnings FATAL => 'all';
5 use Test::More tests => 29;
7 use Function::Parameters {
8 fun => 'function_strict',
9 method => { defaults => 'method_strict', runtime => 1 },
20 ::ok !defined &Bar::f2;
23 ::ok defined &Bar::f2;
26 if (@ARGV < 0) { method f3() {} }
30 fun g1() { (caller 0)[3] }
31 method g2() { (caller 0)[3] }
32 fun Bar::g1() { (caller 0)[3] }
33 method Bar::g2() { (caller 0)[3] }
36 is 'main'->g2, 'main::g2';
37 is Bar::g1, 'Bar::g1';
38 is 'Bar'->g2, 'Bar::g2';
40 use Function::Parameters { fun_r => { defaults => 'function_strict', runtime => 1 } };
50 ::ok !defined &Bar_r::f2;
53 ::ok defined &Bar_r::f2;
56 if (@ARGV < 0) { fun_r f3() {} }
60 fun h1() { (caller 0)[3] }
61 fun_r h2() { (caller 0)[3] }
62 fun Bar::h1() { (caller 0)[3] }
63 fun_r Bar::h2() { (caller 0)[3] }
67 is Bar::h1, 'Bar::h1';
68 is Bar::h2(), 'Bar::h2';
70 fun_r p1($x, $y) :($$) {}
71 is prototype(\&p1), '$$';
72 is prototype('p1'), '$$';
73 is prototype('main::p1'), '$$';
75 fun_r Bar::p2($x, $y = 0) :($;$) {}
76 is prototype(\&Bar::p2), '$;$';
77 is prototype('Bar::p2'), '$;$';