summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-06-11 13:31:45 +0000
committerDaniel Jasper <djasper@google.com>2015-06-11 13:31:45 +0000
commit20580fd5d378e952dff9d1f0331b27aee43b2ccd (patch)
tree548baecd8f3384ad1304575882d7fc9b53a347d2 /clang/unittests/Format/FormatTestJS.cpp
parent56691b8cb93c2d05c2679a8bf412a9913b3198dd (diff)
downloadbcm5719-llvm-20580fd5d378e952dff9d1f0331b27aee43b2ccd.tar.gz
bcm5719-llvm-20580fd5d378e952dff9d1f0331b27aee43b2ccd.zip
clang-format: Make SFS_Inline imply SFS_Empty.
In the long run, these two might be independent or we might to only allow specific combinations. Until we have a corresponding request, however, it is hard to do the right thing and choose the right configuration options. Thus, just don't touch the options yet and just modify the behavior slightly. llvm-svn: 239531
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index d817b6c93e0..8f7202eeb20 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -252,6 +252,7 @@ TEST_F(FormatTestJS, FormatsFreestandingFunctions) {
" function inner2(a, b) { return a; }\n"
" inner2(a, b);\n"
"}");
+ verifyFormat("function f() {}");
}
TEST_F(FormatTestJS, ArrayLiterals) {
@@ -707,12 +708,9 @@ TEST_F(FormatTestJS, Modules) {
verifyFormat("export function fn() {\n"
" return 'fn';\n"
"}");
- verifyFormat("export function A() {\n"
- "}\n"
- "export default function B() {\n"
- "}\n"
- "export function C() {\n"
- "}");
+ verifyFormat("export function A() {}\n"
+ "export default function B() {}\n"
+ "export function C() {}");
verifyFormat("export const x = 12;");
verifyFormat("export default class X {}");
verifyFormat("export {X, Y} from 'some/module.js';");
@@ -819,12 +817,12 @@ TEST_F(FormatTestJS, TypeArguments) {
verifyFormat("foo<Y>(a);");
verifyFormat("var x: X<Y>[];");
verifyFormat("class C extends D<E> implements F<G>, H<I> {}");
- verifyFormat("function f(a: List<any> = null) {\n}");
- verifyFormat("function f(): List<any> {\n}");
+ verifyFormat("function f(a: List<any> = null) {}");
+ verifyFormat("function f(): List<any> {}");
}
TEST_F(FormatTestJS, OptionalTypes) {
- verifyFormat("function x(a?: b, c?, d?) {\n}");
+ verifyFormat("function x(a?: b, c?, d?) {}");
verifyFormat("class X {\n"
" y?: z;\n"
" z?;\n"
@@ -838,8 +836,7 @@ TEST_F(FormatTestJS, OptionalTypes) {
" aaaaaaaa?: string,\n"
" aaaaaaaaaaaaaaa?: boolean,\n"
" aaaaaa?: List<string>\n"
- "}) {\n"
- "}");
+ "}) {}");
}
TEST_F(FormatTestJS, IndexSignature) {
OpenPOWER on IntegriCloud