summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 3d9677922cf..ffcc34d971f 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1293,5 +1293,14 @@ TEST_F(FormatTestJS, SupportShebangLines) {
"var x = hello();");
}
+TEST_F(FormatTestJS, NonNullAssertionOperator) {
+ verifyFormat("let x = foo!.bar();\n");
+ verifyFormat("let x = foo ? bar! : baz;\n");
+ verifyFormat("let x = !foo;\n");
+ verifyFormat("let x = foo[0]!;\n");
+ verifyFormat("let x = (foo)!;\n");
+ verifyFormat("let x = {foo: 1}!;\n");
+}
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud