File: 304_constant_codeinfo.t

package info (click to toggle)
libclass-mop-perl 1.04-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,244 kB
  • ctags: 1,272
  • sloc: perl: 5,192; ansic: 241; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Test::More;

use Class::MOP;

{
    package Foo;
    use constant FOO => 'bar';
}

my $meta = Class::MOP::Class->initialize('Foo');

my $syms = $meta->get_all_package_symbols('CODE');
is(ref $syms->{FOO}, 'CODE', 'get constant symbol');

undef $syms;

$syms = $meta->get_all_package_symbols('CODE');
is(ref $syms->{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');

done_testing;