make 'method main' work
[p5sagit/Devel-Declare.git] / t / sugar.t
index 0f1b685..a582e4b 100644 (file)
--- a/t/sugar.t
+++ b/t/sugar.t
@@ -58,6 +58,8 @@ my ($test_method1, $test_method2, @test_list);
     return join(', ', ref $self, $what);
   };
 
+  method main () { return "main"; };
+
   #@test_list = method { 1 }, sub { 2 }, method () { 3 }, sub { 4 };
 
 }
@@ -72,6 +74,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');