3 use Test::More tests => 16;
5 use warnings FATAL => 'all';
8 sub Burlap::fun (&) { $_[0]->() }
11 use Function::Parameters;
13 is fun { 2 + 2 }->(), 4;
23 ::is fun { 'singing' }, 'singing';
27 sub proc (&) { &Burlap::fun }
29 use Function::Parameters { proc => 'function' };
38 use Function::Parameters;
40 is proc () { 'bla' }->(), 'bla';
41 is method () { $self }->('der'), 'der';
44 no Function::Parameters;
46 is proc { 'unk' }, 'unk';
48 is eval('fun foo($x) { $x; } 1'), undef;
49 like $@, qr/syntax error/;
52 is proc () { 'bla' }->(), 'bla';
53 is method () { $self }->('der'), 'der';
55 no Function::Parameters 'proc';
56 is proc { 'unk2' }, 'unk2';
57 is method () { $self }->('der2'), 'der2';
59 is proc () { 'bla3' }->(), 'bla3';
60 is eval('fun foo($x) { $x; } 1'), undef;
61 like $@, qr/syntax error/;