summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-09-04 14:58:30 +0000
committerDaniel Jasper <djasper@google.com>2014-09-04 14:58:30 +0000
commit94e11d02d88ea33c3212d3dab3dc0245509c8fe5 (patch)
treeb41bc26c86f7ac34aef529a9145f90ec5d255fb8 /clang/unittests/Format
parent2132b704ff72ba0f55793a2faea8323900cb619a (diff)
downloadbcm5719-llvm-94e11d02d88ea33c3212d3dab3dc0245509c8fe5.tar.gz
bcm5719-llvm-94e11d02d88ea33c3212d3dab3dc0245509c8fe5.zip
clang-format: [JS] Support comments in dict literals.
Before: var stuff = { // comment for update update : false, // comment for update modules : false, // comment for update tasks : false }; After: var stuff = { // comment for update update : false, // comment for update modules : false, // comment for update tasks : false }; llvm-svn: 217157
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index f8802b85d60..4b0d1e77bd7 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -111,6 +111,14 @@ TEST_F(FormatTestJS, ContainerLiterals) {
" f(); //\n"
" }\n"
"};");
+ verifyFormat("var stuff = {\n"
+ " // comment for update\n"
+ " update: false,\n"
+ " // comment for modules\n"
+ " modules: false,\n"
+ " // comment for tasks\n"
+ " tasks: false\n"
+ "};");
}
TEST_F(FormatTestJS, SpacesInContainerLiterals) {
OpenPOWER on IntegriCloud