summaryrefslogtreecommitdiff
path: root/dist/Carp/t/vivify_stash.t
diff options
context:
space:
mode:
Diffstat (limited to 'dist/Carp/t/vivify_stash.t')
-rw-r--r--dist/Carp/t/vivify_stash.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/dist/Carp/t/vivify_stash.t b/dist/Carp/t/vivify_stash.t
index 226f960446..68dc9a7258 100644
--- a/dist/Carp/t/vivify_stash.t
+++ b/dist/Carp/t/vivify_stash.t
@@ -1,4 +1,4 @@
-BEGIN { print "1..2\n"; }
+BEGIN { print "1..4\n"; }
our $has_utf8; BEGIN { $has_utf8 = exists($::{"utf8::"}); }
our $has_overload; BEGIN { $has_overload = exists($::{"overload::"}); }
@@ -9,4 +9,15 @@ sub { Carp::longmess() }->(\1);
print !(exists($::{"utf8::"}) xor $has_utf8) ? "" : "not ", "ok 1\n";
print !(exists($::{"overload::"}) xor $has_overload) ? "" : "not ", "ok 2\n";
+# Autovivify $::{"overload::"}
+() = \$::{"overload::"};
+() = \$::{"utf8::"};
+eval { sub { Carp::longmess() }->(\1) };
+print $@ eq '' ? "ok 3\n" : "not ok 3\n# $@";
+
+# overload:: glob without hash
+undef *{"overload::"};
+eval { sub { Carp::longmess() }->(\1) };
+print $@ eq '' ? "ok 4\n" : "not ok 4\n# $@";
+
1;