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'; |
97589313 | 8 | require './test.pl'; |
036b4402 | 9 | } |
10 | ||
97589313 | 11 | plan 7; |
def3634b | 12 | |
13 | use constant MyClass => 'Foo::Bar::Biz::Baz'; | |
14 | ||
15 | { | |
16 | package Foo::Bar::Biz::Baz; | |
0a0ab32c | 17 | 1; |
def3634b | 18 | } |
19 | ||
20 | for (qw(Foo Foo:: MyClass __PACKAGE__)) { | |
21 | eval "sub { my $_ \$obj = shift; }"; | |
22 | ok ! $@; | |
23 | # print $@ if $@; | |
24 | } | |
25 | ||
26 | use constant NoClass => 'Nope::Foo::Bar::Biz::Baz'; | |
27 | ||
28 | for (qw(Nope Nope:: NoClass)) { | |
29 | eval "sub { my $_ \$obj = shift; }"; | |
30 | ok $@; | |
31 | # print $@ if $@; | |
32 | } |