diff options
author | Daniel Jasper <djasper@google.com> | 2015-07-10 13:39:26 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-07-10 13:39:26 +0000 |
commit | b9a52814bf80e64583b13a137ed4a7768b2fa460 (patch) | |
tree | 3311918cb3e8ba832c40a6b17d072f6570b8faba /clang/unittests/Format/FormatTestJS.cpp | |
parent | 4f8d26230c83d630a7dbc0a7411beb9f25c4c6e0 (diff) | |
download | bcm5719-llvm-b9a52814bf80e64583b13a137ed4a7768b2fa460.tar.gz bcm5719-llvm-b9a52814bf80e64583b13a137ed4a7768b2fa460.zip |
clang-format: [JS] Assign proper penalties when breaking a type annotation
Before:
class Test {
aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa:
aaaaaaaaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}
}
After:
class Test {
aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaa):
aaaaaaaaaaaaaaaaaaaaaa {}
}
llvm-svn: 241908
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 24891f54a6e..d068d35d7d3 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -687,6 +687,10 @@ TEST_F(FormatTestJS, ClassDeclarations) { verifyFormat("class C {\n static x(): string { return 'asd'; }\n}"); verifyFormat("class C extends P implements I {}"); verifyFormat("class C extends p.P implements i.I {}"); + verifyFormat("class Test {\n" + " aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaa):\n" + " aaaaaaaaaaaaaaaaaaaaaa {}\n" + "}"); // ':' is not a type declaration here. verifyFormat("class X {\n" |