Make get_all_package_symbols return a hashref in scalar context.
[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 => 2;
6
7 use Class::MOP;
8
9 {
10     package Foo;
11     use constant FOO => 'bar';
12 }
13
14 my $meta = Class::MOP::Class->initialize('Foo');
15
16 my $syms = $meta->get_all_package_symbols('CODE');
17 is(ref $syms->{FOO}, 'CODE', 'get constant symbol');
18
19 undef $syms;
20
21 $syms = $meta->get_all_package_symbols('CODE');
22 is(ref $syms->{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');