summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/op/my_stash.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/op/my_stash.t')
-rwxr-xr-xcontrib/perl5/t/op/my_stash.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/perl5/t/op/my_stash.t b/contrib/perl5/t/op/my_stash.t
new file mode 100755
index 0000000..4a1d502
--- /dev/null
+++ b/contrib/perl5/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 $@;
+}
OpenPOWER on IntegriCloud