X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsugar.t;h=747835429025ca5fdfa031b9bd0d00e8ddeded6e;hb=8343b16e878b4ba015aea44f095452ded06129a7;hp=dffca84da4cf25f67f33a699d5b7932a505823d5;hpb=8eb4a3c5baa0c49f8bda4ef7b53cf5d16bc49b6d;p=p5sagit%2FDevel-Declare.git diff --git a/t/sugar.t b/t/sugar.t index dffca84..7478354 100644 --- a/t/sugar.t +++ b/t/sugar.t @@ -1,3 +1,5 @@ +use strict; +use warnings; use Devel::Declare; BEGIN { @@ -58,11 +60,13 @@ my ($test_method1, $test_method2, @test_list); return join(', ', ref $self, $what); }; - @test_list = method { 1 }, sub { 2 }, method () { 3 }, sub { 4 }; + method main () { return "main"; }; + + #@test_list = method { 1 }, sub { 2 }, method () { 3 }, sub { 4 }; } -use Test::More 'no_plan'; +use Test::More; my $o = DeclareTest->new(attr => "value"); @@ -72,6 +76,8 @@ is($o->{attr}, 'value', '@_ args ok'); is($o->foo('yay'), 'DeclareTest: Foo: yay', 'method with argument ok'); +is($o->main, 'main', 'declaration of package named method ok'); + $o->upgrade; isa_ok($o, 'DeclareTest2'); @@ -83,3 +89,5 @@ is($o->$test_method1('no', 'yes'), 'value, yes', 'anon method with @_ ok'); is($o->$test_method2('this'), 'DeclareTest2, this', 'anon method with proto ok'); #warn map { $_->() } @test_list; + +done_testing;