diff options
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index ff28f304be99..ba6ff0236085 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -548,15 +548,14 @@ TEST_F(FormatTestJS, AsyncFunctions) { " // Comment.\n" " return async.then();\n" "}\n"); - verifyFormat("for async (const x of y) {\n" + verifyFormat("for await (const x of y) {\n" " console.log(x);\n" "}\n"); verifyFormat("function asyncLoop() {\n" - " for async (const x of y) {\n" + " for await (const x of y) {\n" " console.log(x);\n" " }\n" "}\n"); - } TEST_F(FormatTestJS, FunctionParametersTrailingComma) { @@ -1824,6 +1823,11 @@ TEST_F(FormatTestJS, NonNullAssertionOperator) { verifyFormat("let x = !foo;\n"); verifyFormat("let x = foo[0]!;\n"); verifyFormat("let x = (foo)!;\n"); + verifyFormat("let x = x(foo!);\n"); + verifyFormat( + "a.aaaaaa(a.a!).then(\n" + " x => x(x));\n", + getGoogleJSStyleWithColumns(20)); verifyFormat("let x = foo! - 1;\n"); verifyFormat("let x = {foo: 1}!;\n"); verifyFormat( |