aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2021-12-03 11:20:56 +0100
committerMartin Probst <martin@probst.io>2021-12-06 19:01:24 +0100
commit327d966365d7b34abd25a920e1f7b5aecfa5c70f (patch)
tree5babb219fc7ee8a6e94c5d8c9d7ccd161f78d1eb /clang/unittests/Format/FormatTestJS.cpp
parent4a16fe1369f3ab0e98261d4bd133034425d0523c (diff)
downloadllvm-327d966365d7b34abd25a920e1f7b5aecfa5c70f.zip
llvm-327d966365d7b34abd25a920e1f7b5aecfa5c70f.tar.gz
llvm-327d966365d7b34abd25a920e1f7b5aecfa5c70f.tar.bz2
clang-format: [JS] test case for numeric separators.
ES2021 allows numeric literals using `_` as a separator. This already works, but had no test. Differential Revision: https://reviews.llvm.org/D115147
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 0c8329d..069b7b1 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -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