aboutsummaryrefslogtreecommitdiff
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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 4b29ba7..c25228a 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -2850,5 +2850,22 @@ TEST_F(FormatTestJS, DontBreakFieldsAsGoToLabels) {
"};");
}
+TEST_F(FormatTestJS, BreakAfterOpenBracket) {
+ auto Style = getGoogleStyle(FormatStyle::LK_JavaScript);
+ EXPECT_EQ(Style.AlignAfterOpenBracket, FormatStyle::BAS_AlwaysBreak);
+ verifyFormat("ctrl.onCopy(/** @type {!WizEvent}*/ (\n"
+ " {event, targetElement: {el: () => selectedElement}}));",
+ Style);
+ verifyFormat("failedUserIds.push(...subscriptioxxxxxxxxxxxxnSubset.map(\n"
+ " subscxxxxxxxxxxxxription => subscription.getUserId()));",
+ Style);
+ verifyFormat("failedUserIds.push(!subscriptioxxxxxxxxxxxxnSubset.map(\n"
+ " subscxxxxxxxxxxxxription => subscription.getUserId()));",
+ Style);
+ verifyFormat("failedUserIds.push(await subscriptioxxxxxxxxxxxxnSubset.map(\n"
+ " subscxxxxxxxxxxxxription => subscription.getUserId()));",
+ Style);
+}
+
} // namespace format
} // end namespace clang