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