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