Commit | Line | Data |
c2cc003f |
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 | |
75e99e0b |
24 | chomp(my $out = `$^X t/global-destruction-helper.pl`); |
25 | |
26 | is( |
27 | $out, 'true', |
c2cc003f |
28 | 'in_global_destruction state is passed to DEMOLISH properly (true)' |
75e99e0b |
29 | ); |
c2cc003f |
30 | |
31 | done_testing; |