summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
authorJoshua ben Jore <twists@gmail.com>2012-01-09 20:39:22 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-09 20:39:22 -0800
commit2537c17b0fdedb3e9b4301852ab5f7e7d6e38f19 (patch)
treeafebee5491de4962740d8a17aec098c291eedf45 /lib/overload.t
parente6bb0a40852b954f3cc56d4b9bbfccef906b70a5 (diff)
downloadperl-2537c17b0fdedb3e9b4301852ab5f7e7d6e38f19.tar.gz
[perl #40333] Another test
This test includes an explosive class, that overload::Overloaded should be able to handle.
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/overload.t b/lib/overload.t
index 37c7c0ae77..e8bb9233d5 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -48,7 +48,7 @@ package main;
$| = 1;
BEGIN { require './test.pl' }
-plan tests => 5038;
+plan tests => 5039;
use Scalar::Util qw(tainted);
@@ -2219,5 +2219,17 @@ package o { use overload '""' => sub { 'keck' };
ok !overload::Overloaded(new proxy new o),
'overload::Overloaded does not incorrectly return true for proxy classes';
+# Another test, based on the type of explosive test class for which
+# perl #40333 was filed.
+{
+ package broken_can;
+ sub can {}
+ use overload '""' => sub {"Ahoy!"};
+
+ package main;
+ my $obj = bless [], 'broken_can';
+ ok(overload::Overloaded($obj));
+}
+
# EOF