summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-01-14 05:37:52 +0000
committerDaniel Jasper <djasper@google.com>2016-01-14 05:37:52 +0000
commit11a876533ee63969493b324d5143bca7adfb198f (patch)
treee7ded1e56bd5e7969f5c1a8e6ef1eb92da43416a /clang/unittests/Format/FormatTestJS.cpp
parentc040ad5fde6fb43d256c36d2c1e7bbe0014f6758 (diff)
downloadbcm5719-llvm-11a876533ee63969493b324d5143bca7adfb198f.tar.gz
bcm5719-llvm-11a876533ee63969493b324d5143bca7adfb198f.zip
clang-format: [JS] Fix incorrect line break leading to semicolon insertion.
clang-format only works for JavaScript code, if all the semicolons are present anyway, so this linebreak can never be desired. Before (with appropriate statement lengths or column limit): return [ aaa ]; After: return [ aaaa ]; llvm-svn: 257741
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 0e0f64a31ac..38fa5cd2b5b 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -591,6 +591,10 @@ TEST_F(FormatTestJS, AutomaticSemicolonInsertion) {
verifyFormat("throw aaaaa;", getGoogleJSStyleWithColumns(10));
verifyFormat("aaaaaaaaa++;", getGoogleJSStyleWithColumns(10));
verifyFormat("aaaaaaaaa--;", getGoogleJSStyleWithColumns(10));
+ verifyFormat("return [\n"
+ " aaa\n"
+ "];",
+ getGoogleJSStyleWithColumns(12));
}
TEST_F(FormatTestJS, ClosureStyleCasts) {
OpenPOWER on IntegriCloud