We only need local $? if we inline calls to DEMOLISH
[gitmo/Moose.git] / t / cmop / constant_codeinfo.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 use Class::MOP;
6
7 {
8     package Foo;
9     use constant FOO => 'bar';
10 }
11
12 my $meta = Class::MOP::Class->initialize('Foo');
13
14 my $syms = $meta->get_all_package_symbols('CODE');
15 is(ref $syms->{FOO}, 'CODE', 'get constant symbol');
16
17 undef $syms;
18
19 $syms = $meta->get_all_package_symbols('CODE');
20 is(ref $syms->{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');
21
22 done_testing;