4 use Test::More tests => 12;
8 use Function::Parameters {
23 func foo($x, $y, $z) {
30 return $d . $this->{$k} . $d;
33 is foo('a', 'b', 'c'), 'bacb';
34 is bar({ab => 'cd'}, 'ab', 'e'), 'abecdabe';
36 my $baz = f ($x) { $x * 2 + 1 };
41 map [__DIR__ . "/name_$_->[0].fail", @$_[1 .. $#$_]],
42 ['1', qr/expect.*function.*name/],
43 ['2', qr/expect.*function.*body/],
44 ['3', qr/expect.*function.*name/],
45 ['4', qr/Global symbol "\$self" requires explicit package name/]
47 my ($file, $pat) = @$fail;
52 is $done, undef, "faulty code doesn't load";
53 $exc or die "$file: $err";