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