summaryrefslogtreecommitdiff
path: root/t/op/quotemeta.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
commit3aa33fe55ba20233f560f0c549294d8e83806012 (patch)
treec1b0f0f2434610012cab3d272fd45f8006b55411 /t/op/quotemeta.t
parentdfcb284a2bcae98854733134f50bc110c487b8a3 (diff)
downloadperl-3aa33fe55ba20233f560f0c549294d8e83806012.tar.gz
reverse() and quotemeta() weren't preserving utf8-ness; add tests
p4raw-id: //depot/perl@6087
Diffstat (limited to 't/op/quotemeta.t')
-rwxr-xr-xt/op/quotemeta.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/op/quotemeta.t b/t/op/quotemeta.t
index 60e5b7be05..ec247f8ce7 100755
--- a/t/op/quotemeta.t
+++ b/t/op/quotemeta.t
@@ -6,14 +6,14 @@ BEGIN {
require Config; import Config;
}
-print "1..15\n";
+print "1..17\n";
if ($Config{ebcdic} eq 'define') {
$_=join "", map chr($_), 129..233;
# 105 characters - 52 letters = 53 backslashes
# 105 characters + 53 backslashes = 158 characters
- $_=quotemeta $_;
+ $_= quotemeta $_;
if ( length == 158 ){print "ok 1\n"} else {print "not ok 1\n"}
# 104 non-backslash characters
if (tr/\\//cd == 104){print "ok 2\n"} else {print "not ok 2\n"}
@@ -22,7 +22,7 @@ if ($Config{ebcdic} eq 'define') {
# 96 characters - 52 letters - 10 digits - 1 underscore = 33 backslashes
# 96 characters + 33 backslashes = 129 characters
- $_=quotemeta $_;
+ $_= quotemeta $_;
if ( length == 129 ){print "ok 1\n"} else {print "not ok 1\n"}
# 95 non-backslash characters
if (tr/\\//cd == 95){print "ok 2\n"} else {print "not ok 2\n"}
@@ -42,3 +42,6 @@ print "\Q\u\LpE.X.R\EL\E." eq "Pe\\.x\\.rL." ? "ok 12\n" : "not ok 12 \n";
print "\Q\l\UPe*x*r\El\E*" eq "pE\\*X\\*Rl*" ? "ok 13\n" : "not ok 13 \n";
print "\U\lPerl\E\E\E\E" eq "pERL" ? "ok 14\n" : "not ok 14 \n";
print "\l\UPerl\E\E\E\E" eq "pERL" ? "ok 15\n" : "not ok 15 \n";
+
+print length(quotemeta("\x{263a}")) == 1 ? "ok 16\n" : "not ok 16\n";
+print quotemeta("\x{263a}") eq "\x{263a}" ? "ok 17\n" : "not ok 17\n";