This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert range.t to test.pl
[perl5.git] / t / op / my_stash.t
1 #!./perl
2
3 package Foo;
4
5 BEGIN {
6     chdir 't' if -d 't';
7     @INC = '../lib';
8 }
9
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;
18     1;
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 }