Commit | Line | Data |
fa3f5c84 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
a1644fa1 |
5 | use Test::More tests => 2; |
fa3f5c84 |
6 | |
a1644fa1 |
7 | use Class::MOP; |
fa3f5c84 |
8 | |
9 | { |
10 | package Foo; |
11 | use constant FOO => 'bar'; |
12 | } |
13 | |
14 | my $meta = Class::MOP::Class->initialize('Foo'); |
15 | |
6ccb3af5 |
16 | my $syms = $meta->get_all_package_symbols('CODE'); |
17 | is(ref $syms->{FOO}, 'CODE', 'get constant symbol'); |
fa3f5c84 |
18 | |
6ccb3af5 |
19 | undef $syms; |
fa3f5c84 |
20 | |
6ccb3af5 |
21 | $syms = $meta->get_all_package_symbols('CODE'); |
22 | is(ref $syms->{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference'); |