summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/t/op/my_stash.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/t/op/my_stash.t')
-rw-r--r--gnu/usr.bin/perl/t/op/my_stash.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/t/op/my_stash.t b/gnu/usr.bin/perl/t/op/my_stash.t
new file mode 100644
index 00000000000..4a1d5022e02
--- /dev/null
+++ b/gnu/usr.bin/perl/t/op/my_stash.t
@@ -0,0 +1,31 @@
+#!./perl
+
+package Foo;
+
+BEGIN {
+ @INC = '../lib';
+}
+
+use Test;
+
+plan tests => 7;
+
+use constant MyClass => 'Foo::Bar::Biz::Baz';
+
+{
+ package Foo::Bar::Biz::Baz;
+}
+
+for (qw(Foo Foo:: MyClass __PACKAGE__)) {
+ eval "sub { my $_ \$obj = shift; }";
+ ok ! $@;
+# print $@ if $@;
+}
+
+use constant NoClass => 'Nope::Foo::Bar::Biz::Baz';
+
+for (qw(Nope Nope:: NoClass)) {
+ eval "sub { my $_ \$obj = shift; }";
+ ok $@;
+# print $@ if $@;
+}