From 11a876533ee63969493b324d5143bca7adfb198f Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 14 Jan 2016 05:37:52 +0000 Subject: 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 --- clang/unittests/Format/FormatTestJS.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests/Format/FormatTestJS.cpp') 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) { -- cgit v1.2.3