From: Florian Ragwitz Date: Fri, 4 Sep 2009 03:29:26 +0000 (+0200) Subject: Fix warnins in fail.t. X-Git-Tag: 0.006000~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78ac150eed7a9e490339fe8cd31e270d55160646;p=p5sagit%2FDevel-Declare.git Fix warnins in fail.t. --- diff --git a/t/fail.t b/t/fail.t index 2908845..da59924 100644 --- a/t/fail.t +++ b/t/fail.t @@ -1,23 +1,31 @@ -use Devel::Declare; +use strict; +use warnings; +use Test::More 'no_plan'; use Devel::Declare::MethodInstaller::Simple; -BEGIN { Devel::Declare::MethodInstaller::Simple->install_methodhandler(name => 'method', into => 'main') }; - -use Test::More 'no_plan'; +BEGIN { + Devel::Declare::MethodInstaller::Simple->install_methodhandler( + name => 'method', + into => __PACKAGE__, + ); +} TODO: { - local $TODO='Method does not throw proper errors for bad parens yet'; + local $TODO = 'Method does not throw proper errors for bad parens yet'; + eval 'method main ( { return "foo" }'; - like($@,qr/Prototype\snot\sterminated/,'Missing end parens'); + like($@, qr/Prototype\snot\sterminated/, 'Missing end parens'); eval 'method main ) { return "foo" }'; - like($@,qr/Illegal\sdeclaration\sof\ssubroutine/,'Missing start parens'); + like($@, qr/Illegal\sdeclaration\sof\ssubroutine/, 'Missing start parens'); }; TODO: { - local $TODO='method does not disallow invalid sub names'; - eval 'method 1main() { return "foo" }','Sub starting with a number'; - like($@,qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/); - eval 'method møø() { return "foo" }','Sub with unicode'; - like($@,qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/); -}; \ No newline at end of file + local $TODO = 'method does not disallow invalid sub names'; + + eval 'method 1main() { return "foo" }'; + like($@, qr/Illegal\sdeclaration\sof\sanonymous\ssubroutine/, 'starting with a number'); + + eval 'method møø() { return "foo" }'; + like($@, qr/Illegal\sdeclaration\sof\ssubroutine\smain\:\:m/, 'with unicode'); +};