This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
integrate changes#6252..6256,6259..6260
[perl5.git] / t / op / my_stash.t
CommitLineData
a5e3f89e
DM
1#!./perl
2
3package Foo;
4
b1fb3988
GS
5BEGIN {
6 unshift @INC, "../lib";
7}
8
a5e3f89e
DM
9use Test;
10
11plan tests => 7;
12
13use constant MyClass => 'Foo::Bar::Biz::Baz';
14
15{
16 package Foo::Bar::Biz::Baz;
17}
18
19for (qw(Foo Foo:: MyClass __PACKAGE__)) {
20 eval "sub { my $_ \$obj = shift; }";
21 ok ! $@;
22# print $@ if $@;
23}
24
25use constant NoClass => 'Nope::Foo::Bar::Biz::Baz';
26
27for (qw(Nope Nope:: NoClass)) {
28 eval "sub { my $_ \$obj = shift; }";
29 ok $@;
30# print $@ if $@;
31}