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