Commit | Line | Data |
---|---|---|
ec6a9911 | 1 | #!./perl |
2 | ||
3 | package Foo; | |
4 | ||
5 | use Test; | |
6 | ||
7 | plan tests => 7; | |
8 | ||
9 | use constant MyClass => 'Foo::Bar::Biz::Baz'; | |
10 | ||
11 | { | |
12 | package Foo::Bar::Biz::Baz; | |
13 | } | |
14 | ||
15 | for (qw(Foo Foo:: MyClass __PACKAGE__)) { | |
16 | eval "sub { my $_ \$obj = shift; }"; | |
17 | ok ! $@; | |
18 | # print $@ if $@; | |
19 | } | |
20 | ||
21 | use constant NoClass => 'Nope::Foo::Bar::Biz::Baz'; | |
22 | ||
23 | for (qw(Nope Nope:: NoClass)) { | |
24 | eval "sub { my $_ \$obj = shift; }"; | |
25 | ok $@; | |
26 | # print $@ if $@; | |
27 | } |