Regenerate test files
[gitmo/Mouse.git] / t / 100_bugs / 014_DEMOLISHALL.t
CommitLineData
fde8e43f 1#!/usr/bin/env perl
2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
5use strict;
6use warnings;
7use Test::More;
8$TODO = q{Mouse is not yet completed};
9
10my @called;
11
12do {
13 package Class;
14 use Mouse;
15
16 sub DEMOLISH {
17 push @called, 'Class::DEMOLISH';
18 }
19
20 sub DEMOLISHALL {
21 my $self = shift;
22 push @called, 'Class::DEMOLISHALL';
23 $self->SUPER::DEMOLISHALL(@_);
24 }
25
26 package Child;
27 use Mouse;
28 extends 'Class';
29
30 sub DEMOLISH {
31 push @called, 'Child::DEMOLISH';
32 }
33
34 sub DEMOLISHALL {
35 my $self = shift;
36 push @called, 'Child::DEMOLISHALL';
37 $self->SUPER::DEMOLISHALL(@_);
38 }
39};
40
41is_deeply([splice @called], [], "no DEMOLISH calls yet");
42
43do {
44 my $object = Class->new;
45
46 is_deeply([splice @called], [], "no DEMOLISH calls yet");
47};
48
49is_deeply([splice @called], ['Class::DEMOLISHALL', 'Class::DEMOLISH']);
50
51do {
52 my $child = Child->new;
53 is_deeply([splice @called], [], "no DEMOLISH calls yet");
54
55};
56
57is_deeply([splice @called], ['Child::DEMOLISHALL', 'Class::DEMOLISHALL', 'Child::DEMOLISH', 'Class::DEMOLISH']);
58
59done_testing;