This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
some WinCE compilers require a little correction
[perl5.git] / t / op / my_stash.t
CommitLineData
def3634b
GS
1#!./perl
2
3package Foo;
4
036b4402 5BEGIN {
88587957 6 chdir 't' if -d 't';
20822f61 7 @INC = '../lib';
036b4402
GS
8}
9
def3634b
GS
10use Test;
11
12plan tests => 7;
13
14use constant MyClass => 'Foo::Bar::Biz::Baz';
15
16{
17 package Foo::Bar::Biz::Baz;
0a0ab32c 18 1;
def3634b
GS
19}
20
21for (qw(Foo Foo:: MyClass __PACKAGE__)) {
22 eval "sub { my $_ \$obj = shift; }";
23 ok ! $@;
24# print $@ if $@;
25}
26
27use constant NoClass => 'Nope::Foo::Bar::Biz::Baz';
28
29for (qw(Nope Nope:: NoClass)) {
30 eval "sub { my $_ \$obj = shift; }";
31 ok $@;
32# print $@ if $@;
33}