Commit | Line | Data |
a91e8a78 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | # we need to run a test in GD and this fails |
7 | # use Test::More tests => 3; |
8 | # use ok 'Devel::GlobalDestruction'; |
9 | |
10 | use Scope::Guard; |
11 | |
12 | print "1..4\n"; |
13 | |
14 | sub ok ($$) { |
15 | print "not " if !$_[0]; |
16 | print "ok"; |
17 | print " - $_[1]" if defined $_[1]; |
18 | print "\n"; |
19 | } |
20 | |
21 | ok( eval "use Devel::GlobalDestruction; 1", "use Devel::GlobalDestruction" ); |
22 | |
23 | ok( defined &in_global_destruction, "exported" ); |
24 | |
25 | ok( !in_global_destruction(), "not in GD" ); |
26 | |
27 | our $sg = Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) }); |
28 | |
29 | |