summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 255f11e0ef3..39e4ea8566b 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -205,6 +205,13 @@ TEST_F(FormatTestJS, ContainerLiterals) {
verifyFormat("f({a}, () => {\n"
" g(); //\n"
"});");
+
+ // Keys can be quoted.
+ verifyFormat("var x = {\n"
+ " a: a,\n"
+ " b: b,\n"
+ " 'c': c,\n"
+ "};");
}
TEST_F(FormatTestJS, MethodsInObjectLiterals) {
OpenPOWER on IntegriCloud