clang-format: [JS] test case for numeric separators.
authorMartin Probst <martin@probst.io>
Fri, 3 Dec 2021 10:20:56 +0000 (11:20 +0100)
committerMartin Probst <martin@probst.io>
Mon, 6 Dec 2021 18:01:24 +0000 (19:01 +0100)
ES2021 allows numeric literals using `_` as a separator. This already
works, but had no test.

Differential Revision: https://reviews.llvm.org/D115147

clang/unittests/Format/FormatTestJS.cpp

index 0c8329d..069b7b1 100644 (file)
@@ -2692,5 +2692,9 @@ TEST_F(FormatTestJS, NoBreakAfterAsserts) {
       "}\n");
 }
 
+TEST_F(FormatTestJS, NumericSeparators) {
+  verifyFormat("x = 1_000_000 + 12;", "x = 1_000_000   + 12;");
+}
+
 } // namespace format
 } // end namespace clang