From: Matt S Trout Date: Tue, 15 Nov 2011 00:27:03 +0000 (+0000) Subject: clean up global destruction testing X-Git-Tag: v0.009012~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75e99e0b8c3049c4bff46823af59a467cdd61521;p=gitmo%2FRole-Tiny.git clean up global destruction testing --- diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include index 993a293..515c039 100644 --- a/maint/Makefile.PL.include +++ b/maint/Makefile.PL.include @@ -4,4 +4,6 @@ use Distar; author 'mst - Matt S. Trout (cpan:MSTROUT) '; +manifest_include t => 'global-destruction-helper.pl'; + 1; diff --git a/t/demolish-global_destruction.t b/t/demolish-global_destruction.t index c9da471..62ddf4c 100644 --- a/t/demolish-global_destruction.t +++ b/t/demolish-global_destruction.t @@ -21,9 +21,11 @@ use Test::Fatal; my $foo = Foo->new; } -ok( - $_, +chomp(my $out = `$^X t/global-destruction-helper.pl`); + +is( + $out, 'true', 'in_global_destruction state is passed to DEMOLISH properly (true)' -) for split //, `$^X t/global-destruction-helper.pl`; +); done_testing; diff --git a/t/global-destruction-helper.pl b/t/global-destruction-helper.pl index 13d794c..f238c06 100644 --- a/t/global-destruction-helper.pl +++ b/t/global-destruction-helper.pl @@ -1,7 +1,5 @@ -#!/usr/bin/env perl - -use strict; -use warnings; +use strictures 1; +use lib 'lib'; no warnings 'once'; # work around 5.6.2 { @@ -12,7 +10,7 @@ no warnings 'once'; # work around 5.6.2 my $self = shift; my ($igd) = @_; - print $igd || 0, "\n"; + print $igd ? "true" : "false", "\n"; } }