summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/overload.t b/lib/overload.t
index d778776ef7..b684c4ca33 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -48,7 +48,7 @@ package main;
$| = 1;
BEGIN { require './test.pl'; require './charset_tools.pl' }
-plan tests => 5215;
+plan tests => 5217;
use Scalar::Util qw(tainted);
@@ -2816,6 +2816,16 @@ package bitops2 {
'experimental "bitwise" ops with nomethod'
}
+package length_utf8 {
+ use overload '""' => sub { "\x{100}" };
+ my $o = bless [];
+print length $o, "\n";
+
+ ::is length($o), 1, "overloaded utf8 length";
+ ::is "$o", "\x{100}", "overloaded utf8 value";
+}
+
+
{ # undefining the overload stash -- KEEP THIS TEST LAST
package ant;
use overload '+' => 'onion';