This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
UTF-8 bugs in string length & single line regex matches
[perl5.git] / t / op / length.t
index c4445e3..3170beb 100644 (file)
@@ -115,3 +115,21 @@ print "ok 3\n";
     print "ok 13\n";
     $test++;
 }
+
+# Now for Unicode with magical vtbls
+
+{
+    require Tie::Scalar;
+    my $a;
+    tie $a, 'Tie::StdScalar';  # makes $a magical
+    $a = "\x{263A}";
+    
+    print "not " unless length($a) == 1;
+    print "ok 14\n";
+    $test++;
+
+    use bytes;
+    print "not " unless length($a) == 3;
+    print "ok 15\n";
+    $test++;
+}