aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/numbers.js52
1 files changed, 40 insertions, 12 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js
index 86545fba..000b9ab5 100644
--- a/test/compress/numbers.js
+++ b/test/compress/numbers.js
@@ -1,21 +1,49 @@
hex_numbers_in_parentheses_for_prototype_functions: {
+ beautify = {
+ beautify: true,
+ }
input: {
- (-2);
- (-2).toFixed(0);
+ function f() {
+ (-2);
+ (-2).toFixed(0);
- (2);
- (2).toFixed(0);
+ (2);
+ (2).toFixed(0);
- (0.2);
- (0.2).toFixed(0);
+ (0.2);
+ (0.2).toFixed(0);
- (0.00000002);
- (0.00000002).toFixed(0);
+ (2.34e20);
+ (2.34e20).toFixed(0);
- (1000000000000000128);
- (1000000000000000128).toFixed(0);
- }
- expect_exact: "-2;(-2).toFixed(0);2;2..toFixed(0);.2;.2.toFixed(0);2e-8;2e-8.toFixed(0);0xde0b6b3a7640080;(0xde0b6b3a7640080).toFixed(0);"
+ (0.00000002);
+ (0.00000002).toFixed(0);
+
+ (1000000000000000128);
+ (1000000000000000128).toFixed(0);
+
+ (-1000000000000000128);
+ (-1000000000000000128).toFixed(0);
+ }
+ }
+ expect_exact: [
+ "function f() {",
+ " -2;",
+ " (-2).toFixed(0);",
+ " 2;",
+ " 2..toFixed(0);",
+ " .2;",
+ " .2.toFixed(0);",
+ " 234e18;",
+ " 234e18.toFixed(0);",
+ " 2e-8;",
+ " 2e-8.toFixed(0);",
+ " 0xde0b6b3a7640080;",
+ " (0xde0b6b3a7640080).toFixed(0);",
+ " -0xde0b6b3a7640080;",
+ " (-0xde0b6b3a7640080).toFixed(0);",
+ "}",
+ ]
}
comparisons: {