aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-06 15:57:15 +0800
committerGitHub <noreply@github.com>2018-02-06 15:57:15 +0800
commitd69d8007d6f9d3ee5a202b089ed6319cb33e69f9 (patch)
treec3cac0c096245a987d2b874ce74408231be1b8ca /test
parentc0b8f2a16d4804fe302e5db91995735ee7041c8d (diff)
downloadtracifyjs-d69d8007d6f9d3ee5a202b089ed6319cb33e69f9.tar.gz
tracifyjs-d69d8007d6f9d3ee5a202b089ed6319cb33e69f9.zip
evaluate `to{Low,Upp}erCase()` under `unsafe` (#2886)
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 0d26982c..41b599ed 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -1374,3 +1374,58 @@ issue_2822: {
}
expect_stdout: "PASS"
}
+
+string_case: {
+ options = {
+ evaluate: true,
+ unsafe: true,
+ }
+ input: {
+ console.log("İ".toLowerCase().charCodeAt(0));
+ console.log("I".toLowerCase().charCodeAt(0));
+ console.log("Ş".toLowerCase().charCodeAt(0));
+ console.log("Ğ".toLowerCase().charCodeAt(0));
+ console.log("Ü".toLowerCase().charCodeAt(0));
+ console.log("Ö".toLowerCase().charCodeAt(0));
+ console.log("Ç".toLowerCase().charCodeAt(0));
+ console.log("i".toUpperCase().charCodeAt(0));
+ console.log("ı".toUpperCase().charCodeAt(0));
+ console.log("ş".toUpperCase().charCodeAt(0));
+ console.log("ğ".toUpperCase().charCodeAt(0));
+ console.log("ü".toUpperCase().charCodeAt(0));
+ console.log("ö".toUpperCase().charCodeAt(0));
+ console.log("ç".toUpperCase().charCodeAt(0));
+ }
+ expect: {
+ console.log(105);
+ console.log(105);
+ console.log(351);
+ console.log(287);
+ console.log(252);
+ console.log(246);
+ console.log(231);
+ console.log(73);
+ console.log(73);
+ console.log(350);
+ console.log(286);
+ console.log(220);
+ console.log(214);
+ console.log(199);
+ }
+ expect_stdout: [
+ "105",
+ "105",
+ "351",
+ "287",
+ "252",
+ "246",
+ "231",
+ "73",
+ "73",
+ "350",
+ "286",
+ "220",
+ "214",
+ "199",
+ ]
+}