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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 05aee91a1d5..4a2da1abe0f 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -470,6 +470,16 @@ TEST_F(FormatTestJS, FormatsFreestandingFunctions) {
" inner2(a, b);\n"
"}");
verifyFormat("function f() {}");
+ verifyFormat("function aFunction() {}\n"
+ "(function f() {\n"
+ " var x = 1;\n"
+ "}());\n");
+ // Known issue: this should wrap after {}, but calculateBraceTypes
+ // misclassifies the first braces as a BK_BracedInit.
+ verifyFormat("function aFunction(){} {\n"
+ " let x = 1;\n"
+ " console.log(x);\n"
+ "}\n");
}
TEST_F(FormatTestJS, GeneratorFunctions) {
OpenPOWER on IntegriCloud