Add a failing testcase for get_all_package_symbols and inlined constants.
[gitmo/Class-MOP.git] / t / 304_constant_codeinfo.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More tests => 3;
6
7 BEGIN {
8     use_ok('Class::MOP');
9 }
10
11 {
12     package Foo;
13     use constant FOO => 'bar';
14 }
15
16 my $meta = Class::MOP::Class->initialize('Foo');
17
18 my %syms = $meta->get_all_package_symbols('CODE');
19 is(ref $syms{FOO}, 'CODE', 'get constant symbol');
20
21 undef %syms;
22
23 %syms = $meta->get_all_package_symbols('CODE');
24 is(ref $syms{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');