4 use Test::More tests => 7;
6 use vars qw/@warnings/;
7 BEGIN { $SIG{__WARN__} = sub { push @warnings, @_ } }
9 BEGIN { is(@warnings, 0, 'no warnings yet') }
11 use Function::Parameters;
13 fun with_proto ($x, $y, $z) : ($$$) {
19 fun with_lvalue () : () lvalue { $foo }
22 is(prototype('with_proto'), '$$$', ':proto attribute');
24 is(prototype('with_lvalue'), '', ':proto with other attributes');
26 is(with_lvalue, 1, 'other attributes still there');
28 BEGIN { is(@warnings, 0, 'no warnings with correct :proto declarations') }
30 fun invalid_proto ($x) : (invalid) { $x }
34 # local $TODO = ':proto checks not yet implemented';
35 is(@warnings, 1, 'warning with illegal :proto');
38 qr/Illegal character in prototype for fun invalid_proto : invalid at /,