aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-29 04:40:05 +0800
committerGitHub <noreply@github.com>2017-03-29 04:40:05 +0800
commitfef0bf9ee0367f07dfbca26b144c2995c2b5db5f (patch)
tree729fb76868b8bd6a3df16131a892c02da430adb1 /test/compress
parentae740b933fe9cad714f5a9aac625ae2857d5a04a (diff)
downloadtracifyjs-fef0bf9ee0367f07dfbca26b144c2995c2b5db5f.tar.gz
tracifyjs-fef0bf9ee0367f07dfbca26b144c2995c2b5db5f.zip
improve beautified output of switch blocks (#1721)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/switch.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/compress/switch.js b/test/compress/switch.js
index 5c12449c..82d725f2 100644
--- a/test/compress/switch.js
+++ b/test/compress/switch.js
@@ -680,3 +680,44 @@ issue_1705_3: {
}
expect_stdout: true
}
+
+beautify: {
+ beautify = {
+ beautify: true,
+ }
+ input: {
+ switch (a) {
+ case 0:
+ case 1:
+ break;
+ case 2:
+ default:
+ }
+ switch (b) {
+ case 3:
+ foo();
+ bar();
+ default:
+ break;
+ }
+ }
+ expect_exact: [
+ "switch (a) {",
+ " case 0:",
+ " case 1:",
+ " break;",
+ "",
+ " case 2:",
+ " default:",
+ "}",
+ "",
+ "switch (b) {",
+ " case 3:",
+ " foo();",
+ " bar();",
+ "",
+ " default:",
+ " break;",
+ "}",
+ ]
+}