4 # we need to run a test in GD and this fails
5 # use Test::More tests => 3;
6 # use ok 'Devel::GlobalDestruction';
9 package Test::Scope::Guard;
10 sub new { my ($class, $code) = @_; bless [$code], $class; }
11 sub DESTROY { my $self = shift; $self->[0]->() }
17 print "not " if !$_[0];
19 print " - $_[1]" if defined $_[1];
23 ok( eval "use Devel::GlobalDestruction; 1", "use Devel::GlobalDestruction" );
25 ok( defined &in_global_destruction, "exported" );
27 ok( !in_global_destruction(), "not in GD" );
29 our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) });