Convert all tests to done_testing.
[gitmo/Moose.git] / t / 010_basics / 020-global-destruction.t
CommitLineData
9a7f2b2d 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
9a7f2b2d 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
b288593e 26{
27 package Bar;
28 use Moose;
29
30 sub DEMOLISH {
31 my $self = shift;
32 my ($igd) = @_;
33 ::ok(
34 !$igd,
35 'in_global_destruction state is passed to DEMOLISH properly (false)'
36 );
37 }
38
39 __PACKAGE__->meta->make_immutable;
40}
41
42{
43 my $bar = Bar->new;
44}
45
46ok(
47 $_,
48 'in_global_destruction state is passed to DEMOLISH properly (true)'
49) for split //, `$^X t/010_basics/020-global-destruction-helper.pl`;
50
a28e50e4 51done_testing;