3 use Test::More tests => 11;
5 use warnings FATAL => 'all';
8 use Function::Parameters;
10 fun four { 2 + 2 } fun five() { 1 + four }
12 fun quantum :() {; 0xf00d
15 is four, 4, "basic sanity 1";
16 is five, 5, "basic sanity 2";
17 is quantum, 0xf00d, "basic sanity 3";
19 , 0xf00d / 2, "basic sanity 4 - () proto";
21 is eval('my $x = fun forbidden {}'), undef, "statements aren't expressions";
22 like $@, qr/expect.*function body/;
24 is eval('my $x = { fun forbidden {} }'), undef, "statements aren't expressions 2 - electric boogaloo";
25 like $@, qr/expect.*function body/;
27 is fun { join '.', five, four }->(), '5.4', "can immedicall anon subs";
29 is 0 * fun {} + 42, 42, "* binds tighter than +";
30 is 0 * fun { quantum / q#/ }
31 # } + 42, 42, "* binds tighter than + 2 - electric boogaloo";