make inlining a bit more easily extensible
[gitmo/Class-MOP.git] / t / 304_constant_codeinfo.t
CommitLineData
fa3f5c84 1use strict;
2use warnings;
86a4d873 3use Test::More;
fa3f5c84 4
a1644fa1 5use Class::MOP;
fa3f5c84 6
7{
8 package Foo;
9 use constant FOO => 'bar';
10}
11
12my $meta = Class::MOP::Class->initialize('Foo');
13
6ccb3af5 14my $syms = $meta->get_all_package_symbols('CODE');
15is(ref $syms->{FOO}, 'CODE', 'get constant symbol');
fa3f5c84 16
6ccb3af5 17undef $syms;
fa3f5c84 18
6ccb3af5 19$syms = $meta->get_all_package_symbols('CODE');
20is(ref $syms->{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');
86a4d873 21
22done_testing;