Commit | Line | Data |
9a7f2b2d |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More tests => 2; |
7 | |
61c4a4cd |
8 | { |
9 | package Foo; |
10 | use Moose; |
9a7f2b2d |
11 | |
61c4a4cd |
12 | sub DEMOLISH { |
13 | my $self = shift; |
14 | my ($igd) = @_; |
15 | ::ok( |
16 | !$igd, |
17 | 'in_global_destruction state is passed to DEMOLISH properly (false)' |
18 | ); |
19 | } |
9a7f2b2d |
20 | } |
21 | |
9a7f2b2d |
22 | { |
23 | my $foo = Foo->new; |
24 | } |
61c4a4cd |
25 | |
26 | my $igd = `$^X t/010_basics/020-global-destruction-helper.pl`; |
27 | ok( $igd, |
28 | 'in_global_destruction state is passed to DEMOLISH properly (true)' ); |