perl 5.6.0 and newer have the our keyword
[p5sagit/Devel-GlobalDestruction.git] / t / basic.t
CommitLineData
a91e8a78 1#!/usr/bin/perl
2
3use strict;
4use 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
10use Scope::Guard;
11
12print "1..4\n";
13
14sub ok ($$) {
15 print "not " if !$_[0];
16 print "ok";
17 print " - $_[1]" if defined $_[1];
18 print "\n";
19}
20
21ok( eval "use Devel::GlobalDestruction; 1", "use Devel::GlobalDestruction" );
22
23ok( defined &in_global_destruction, "exported" );
24
25ok( !in_global_destruction(), "not in GD" );
26
27our $sg = Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) });
28
29