summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-21 13:26:58 +0000
committerDaniel Jasper <djasper@google.com>2014-05-21 13:26:58 +0000
commit2a958321c8a149b3f4952dc78a8f6edcbcae1996 (patch)
tree0e6771c20033486e7a789b3eb911d2ab95430857 /clang/unittests/Format/FormatTestJS.cpp
parent301a38b0b75600ecc7e1cec7568f11037ad69f94 (diff)
downloadbcm5719-llvm-2a958321c8a149b3f4952dc78a8f6edcbcae1996.tar.gz
bcm5719-llvm-2a958321c8a149b3f4952dc78a8f6edcbcae1996.zip
clang-format: Fix corner case working around one-per-line dict literals.
Before: var object_literal_with_long_name = { a: 'aaaaaaaaaaaaaaaaaa', b: 'bbbbbbbbbbbbbbbbbb' }; After: var object_literal_with_long_name = { a: 'aaaaaaaaaaaaaaaaaa', b: 'bbbbbbbbbbbbbbbbbb' }; llvm-svn: 209296
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 257c247765b..2aac89eac88 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -92,6 +92,11 @@ TEST_F(FormatTestJS, SpacesInContainerLiterals) {
verifyFormat("var arr = [1, 2, 3];");
verifyFormat("var obj = {a: 1, b: 2, c: 3};");
+ verifyFormat("var object_literal_with_long_name = {\n"
+ " a: 'aaaaaaaaaaaaaaaaaa',\n"
+ " b: 'bbbbbbbbbbbbbbbbbb'\n"
+ "};");
+
verifyFormat("var obj = {a: 1, b: 2, c: 3};",
getChromiumStyle(FormatStyle::LK_JavaScript));
verifyFormat("someVariable = {'a': [{}]};");
OpenPOWER on IntegriCloud