Failing tests for line number issues
[p5sagit/Devel-Declare.git] / t / fail.t
CommitLineData
70570efc 1use Devel::Declare;
2
3use Devel::Declare::MethodInstaller::Simple;
4BEGIN { Devel::Declare::MethodInstaller::Simple->install_methodhandler(name => 'method', into => 'main') };
5
6use Test::More 'no_plan';
7
8TODO: {
9 local $TODO='Method does not throw proper errors for bad parens yet';
10 eval 'method main ( { return "foo" }';
390ce4e8 11 like($@,qr/Prototype\snot\sterminated/,'Missing end parens');
70570efc 12
13 eval 'method main ) { return "foo" }';
390ce4e8 14 like($@,qr/Illegal\sdeclaration\sof\ssubroutine/,'Missing start parens');
15};
16
17TODO: {
6cd03fca 18 local $TODO='method does not disallow invalid sub names';
390ce4e8 19 eval 'method 1main() { return "foo" }','Sub starting with a number';
20 like($@,qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/);
6cd03fca 21 eval 'method møø() { return "foo" }','Sub with unicode';
22 like($@,qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/);
70570efc 23};