provide DEMOLISH
[gitmo/Role-Tiny.git] / t / demolish-global_destruction.t
1
2 use strictures 1;
3 use Test::More;
4 use Test::Fatal;
5
6 {
7     package Foo;
8     use Moo;
9
10     sub DEMOLISH {
11         my $self = shift;
12         my ($igd) = @_;
13         ::ok(
14             !$igd,
15             'in_global_destruction state is passed to DEMOLISH properly (false)'
16         );
17     }
18 }
19
20 {
21     my $foo = Foo->new;
22 }
23
24 ok(
25     $_,
26     'in_global_destruction state is passed to DEMOLISH properly (true)'
27 ) for split //, `$^X t/global-destruction-helper.pl`;
28
29 done_testing;