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.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 29b8aa1ff13..20c10b634bf 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -337,6 +337,14 @@ TEST_F(FormatTestJS, FunctionLiterals) {
" doSomething();\n"
" doSomething();\n"
" }, this));");
+
+ // FIXME: This is bad, we should be wrapping before "function() {".
+ verifyFormat("someFunction(function() {\n"
+ " doSomething(); // break\n"
+ "})\n"
+ " .doSomethingElse(\n"
+ " // break\n"
+ " );");
}
TEST_F(FormatTestJS, InliningFunctionLiterals) {
@@ -455,7 +463,14 @@ TEST_F(FormatTestJS, ArrowFunctions) {
" return a;\n"
"};");
verifyFormat("var x = (a) => a;");
- verifyFormat("var x = (a) => a;");
+
+ // FIXME: This is bad, we should be wrapping before "() => {".
+ verifyFormat("someFunction(() => {\n"
+ " doSomething(); // break\n"
+ "})\n"
+ " .doSomethingElse(\n"
+ " // break\n"
+ " );");
}
TEST_F(FormatTestJS, ReturnStatements) {
OpenPOWER on IntegriCloud