summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
commit416ada0f75bab22b084a1776deb229cd4a669c4d (patch)
tree6eb65f3790434471361628af6199b07a4de92de7 /unittests/Format/FormatTestJS.cpp
parent550ae89a710bf458d47e5b1d183f5e7039c2b384 (diff)
Notes
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r--unittests/Format/FormatTestJS.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp
index d8f887f9c788..92a113111b6a 100644
--- a/unittests/Format/FormatTestJS.cpp
+++ b/unittests/Format/FormatTestJS.cpp
@@ -474,9 +474,8 @@ TEST_F(FormatTestJS, FormatsFreestandingFunctions) {
"(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"
+ verifyFormat("function aFunction() {}\n"
+ "{\n"
" let x = 1;\n"
" console.log(x);\n"
"}\n");
@@ -1233,6 +1232,10 @@ TEST_F(FormatTestJS, ClassDeclarations) {
verifyFormat("class C {\n x: string = 12;\n}");
verifyFormat("class C {\n x(): string => 12;\n}");
verifyFormat("class C {\n ['x' + 2]: string = 12;\n}");
+ verifyFormat("class C {\n"
+ " foo() {}\n"
+ " [bar]() {}\n"
+ "}\n");
verifyFormat("class C {\n private x: string = 12;\n}");
verifyFormat("class C {\n private static x: string = 12;\n}");
verifyFormat("class C {\n static x(): string {\n return 'asd';\n }\n}");