From: Dagfinn Ilmari Mannsåker Date: Tue, 24 Jul 2012 17:09:59 +0000 (+0100) Subject: Add prototype to pure-perl pre-5.14 version X-Git-Tag: Devel-GlobalDestruction-0.07~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-GlobalDestruction.git;a=commitdiff_plain;h=41ec1eaf0c685813f08d5c10727b8d39c46f4aa4 Add prototype to pure-perl pre-5.14 version --- diff --git a/Changes b/Changes index 8aabdb5..d22d8fb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,5 @@ * Actually detect errors in pure-perl test + * Add prototype to pure-perl pre-5.14 version 0.06 Thu, 14 Jun 2012 * De-retardize XS-less behavior under SpeedyCGI diff --git a/lib/Devel/GlobalDestruction.pm b/lib/Devel/GlobalDestruction.pm index 9030ae7..418805d 100644 --- a/lib/Devel/GlobalDestruction.pm +++ b/lib/Devel/GlobalDestruction.pm @@ -39,7 +39,7 @@ else { my ($in_global_destruction, $before_is_installed); -sub in_global_destruction { $in_global_destruction } +sub in_global_destruction () { $in_global_destruction } # This block will fire towards the end of the program execution # Since there is no way for us to generate an END which will execute *last* diff --git a/t/01_basic.t b/t/01_basic.t index c16cab3..ac7f07a 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -19,7 +19,7 @@ BEGIN { sub DESTROY { my $self = shift; $self->[0]->() } } -print "1..4\n"; +print "1..6\n"; my $had_error = 0; END { $? = $had_error }; @@ -34,6 +34,10 @@ ok( eval "use Devel::GlobalDestruction; 1", "use Devel::GlobalDestruction" ); ok( defined &in_global_destruction, "exported" ); +ok( defined prototype \&in_global_destruction, "defined prototype" ); + +ok( prototype \&in_global_destruction eq "", "empty prototype" ); + ok( !in_global_destruction(), "not in GD" ); our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) });