diff options
Diffstat (limited to 't/comp')
-rwxr-xr-x | t/comp/proto.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index f9731ee489..9ac1e0f470 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..110\n"; +print "1..122\n"; my $i = 1; @@ -485,3 +485,12 @@ sub sreftest (\$$) { sreftest($helem{$i}, $i++); sreftest $aelem[0], $i++; } + +# test prototypes when they are evaled and there is a syntax error +for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) { + no warnings 'redefine'; + my $eval = "sub evaled_subroutine $p { &void *; }"; + eval $eval; + print "# eval[$eval]\nnot " unless $@ && $@ =~ /syntax error/; + print "ok ", $i++, "\n"; +} |