summaryrefslogtreecommitdiff
path: root/lib/B/Deparse.t
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-04-09 10:32:03 -0600
committerKarl Williamson <khw@cpan.org>2020-07-17 22:35:50 -0600
commit1e96397227cc347d8d45ff6fc9b7a97015288ecb (patch)
tree2490e3dba6801dea28d9f7e40d11fc9aee84f29a /lib/B/Deparse.t
parent8914f6f03045247496589d55fae327f45ebe76ef (diff)
downloadperl-1e96397227cc347d8d45ff6fc9b7a97015288ecb.tar.gz
B/Deparse.t: Add tests for UTF-8 tr///
This has not previously been tested
Diffstat (limited to 'lib/B/Deparse.t')
-rw-r--r--lib/B/Deparse.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
index 4b7601d365..fb3a7fc912 100644
--- a/lib/B/Deparse.t
+++ b/lib/B/Deparse.t
@@ -1496,6 +1496,49 @@ tr/\000-\375/A-C/cds;
tr/\000-\375/A-D/cds;
tr/\000-\375/A-I/cds;
####
+# tr/// with all the flags: empty replacement
+tr/\x{101}-\x{106}//;
+tr/\x{101}-\x{106}//c;
+tr/\x{101}-\x{106}//d;
+tr/\x{101}-\x{106}//s;
+tr/\x{101}-\x{106}//cd;
+tr/\x{101}-\x{106}//ds;
+tr/\x{101}-\x{106}//cs;
+tr/\x{101}-\x{106}//cds;
+tr/\x{101}-\x{106}//r;
+####
+# tr/// with all the flags: short replacement
+tr/\x{101}-\x{106}/\x{111}/;
+tr/\x{101}-\x{106}/\x{111}/c;
+tr/\x{101}-\x{106}/\x{111}/d;
+tr/\x{101}-\x{106}/\x{111}/s;
+tr/\x{101}-\x{106}/\x{111}/cd;
+tr/\x{101}-\x{106}/\x{111}/ds;
+tr/\x{101}-\x{106}/\x{111}/cs;
+tr/\x{101}-\x{106}/\x{111}/cds;
+tr/\x{101}-\x{106}/\x{111}/r;
+####
+# tr/// with all the flags: equal length replacement
+tr/\x{101}-\x{106}/\x{111}-\x{116}/;
+tr/\x{101}-\x{106}/\x{111}-\x{116}/c;
+tr/\x{101}-\x{106}/\x{111}-\x{116}/s;
+tr/\x{101}-\x{106}/\x{111}-\x{116}/cs;
+tr/\x{101}-\x{106}/\x{111}-\x{116}/r;
+####
+# tr across 255/256 boundary, complemented
+tr/\cA-\x{100}/AB/c;
+tr/\cA-\x{100}/A-C/c;
+tr/\cA-\x{100}/A-D/c;
+tr/\cA-\x{100}/A-I/c;
+tr/\cA-\x{100}/AB/cd;
+tr/\cA-\x{100}/A-C/cd;
+tr/\cA-\x{100}/A-D/cd;
+tr/\cA-\x{100}/A-I/cd;
+tr/\cA-\x{100}/AB/cds;
+tr/\cA-\x{100}/A-C/cds;
+tr/\cA-\x{100}/A-D/cds;
+tr/\cA-\x{100}/A-I/cds;
+####
# [perl #119807] s//\(3)/ge should not warn when deparsed (\3 warns)
s/foo/\(3);/eg;
####