Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sub MAIN in modules should not run. RT #114354
  • Loading branch information
moritz committed Aug 1, 2012
1 parent f5b1f2e commit 95987ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion S06-other/main.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 5;
plan 6;

## If this test file is fudged, then MAIN never executes because
## the fudge script introduces an C<exit(1)> into the mainline.
Expand All @@ -22,4 +22,8 @@ sub MAIN($a, $b, *@c) {

ok( @*ARGS == 5, '@*ARGS has correct elements');

# RT #114354
@*INC.push: 't/spec/packages/';
lives_ok { require HasMain }, 'MAIN in a module did not get executed';

# vim: ft=perl6
6 changes: 6 additions & 0 deletions packages/HasMain.pm
@@ -0,0 +1,6 @@
use v6;
module HasMain {
sub MAIN() { die 'HasMain::Main' }
}
sub MAIN() { die 'MAIN' }

0 comments on commit 95987ec

Please sign in to comment.