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