3 use Test::More 'no_plan';
5 use Devel::Declare::MethodInstaller::Simple;
7 Devel::Declare::MethodInstaller::Simple->install_methodhandler(
14 local $TODO = 'Method does not throw proper errors for bad parens yet';
16 eval 'method main ( { return "foo" }';
17 like($@, qr/Prototype\snot\sterminated/, 'Missing end parens');
19 eval 'method main ) { return "foo" }';
20 like($@, qr/Illegal\sdeclaration\sof\ssubroutine/, 'Missing start parens');
24 local $TODO = 'method does not disallow invalid sub names';
26 eval 'method 1main() { return "foo" }';
27 like($@, qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/, 'starting with a number');
29 eval 'method møø() { return "foo" }';
30 like($@, qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/, 'with unicode');