summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-11-30 10:25:17 +0000
committerMartin Probst <martin@probst.io>2017-11-30 10:25:17 +0000
commitf64fbddb87285b85fcc88b0455e0e731ff14032f (patch)
treea722b217a2f604e7259274d6cb19cb10b4d62246 /unittests
parent66ded8c1f9b811b5a0f31c368f6feaf86ae932d2 (diff)
clang-format: [JS] do not wrap after async/await.
Summary: Otherwise automatic semicolon insertion can trigger, i.e. wrapping produces invalid syntax. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D40642 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTestJS.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp
index 390772db8b..2a929563f7 100644
--- a/unittests/Format/FormatTestJS.cpp
+++ b/unittests/Format/FormatTestJS.cpp
@@ -1152,6 +1152,11 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) {
"const y = 3\n",
"const x = ( 5 + 9)\n"
"const y = 3\n");
+ // Ideally the foo() bit should be indented relative to the async function().
+ verifyFormat("async function\n"
+ "foo() {}",
+ getGoogleJSStyleWithColumns(10));
+ verifyFormat("await theReckoning;", getGoogleJSStyleWithColumns(10));
}
TEST_F(FormatTestJS, AutomaticSemicolonInsertionHeuristic) {