summaryrefslogtreecommitdiff
path: root/t/21-types/GlobRef.t
diff options
context:
space:
mode:
Diffstat (limited to 't/21-types/GlobRef.t')
-rw-r--r--t/21-types/GlobRef.t7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/21-types/GlobRef.t b/t/21-types/GlobRef.t
index ccb6e091..5a5fe5ea 100644
--- a/t/21-types/GlobRef.t
+++ b/t/21-types/GlobRef.t
@@ -82,6 +82,13 @@ my @tests = (
fail => 'ref to hashref' => do { my $x = {}; \$x },
fail => 'ref to coderef' => do { my $x = sub { 1 }; \$x },
fail => 'ref to blessed hashref' => do { my $x = bless({}, 'SomePkg'); \$x },
+ fail => 'object stringifying to ""' => do { package Local::OL::StringEmpty; use overload q[""] => sub { "" }; bless [] },
+ fail => 'object stringifying to "1"' => do { package Local::OL::StringOne; use overload q[""] => sub { "1" }; bless [] },
+ fail => 'object numifying to 0' => do { package Local::OL::NumZero; use overload q[0+] => sub { 0 }; bless [] },
+ fail => 'object numifying to 1' => do { package Local::OL::NumOne; use overload q[0+] => sub { 1 }; bless [] },
+ fail => 'object overloading arrayref' => do { package Local::OL::Array; use overload q[@{}] => sub { $_[0]{array} }; bless {array=>[]} },
+ fail => 'object overloading hashref' => do { package Local::OL::Hash; use overload q[%{}] => sub { $_[0][0] }; bless [{}] },
+ fail => 'object overloading coderef' => do { package Local::OL::Code; use overload q[&{}] => sub { $_[0][0] }; bless [sub { 1 }] },
#TESTS
);