summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-08-22 14:23:30 +0000
committerMartin Probst <martin@probst.io>2016-08-22 14:23:30 +0000
commited87d788d610063e7c6e74a12565001ce77a0d73 (patch)
treeafa195e548a9a8efb992fb0583b860671adadf72 /clang/unittests/Format/FormatTestJS.cpp
parent13fa33012b93c2c824ddf864c70ebff41a378a6d (diff)
downloadbcm5719-llvm-ed87d788d610063e7c6e74a12565001ce77a0d73.tar.gz
bcm5719-llvm-ed87d788d610063e7c6e74a12565001ce77a0d73.zip
clang-format: [JS] supports casts to types starting with punctuation ("{[(").
Before: x as{x: number} After: x as {x: number} Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D23761 llvm-svn: 279436
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 838caffc708..f6e8ff2f385 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1219,6 +1219,9 @@ TEST_F(FormatTestJS, CastSyntax) {
" 2\n"
"];");
verifyFormat("var x = [{x: 1} as type];");
+ verifyFormat("x = x as [a, b];");
+ verifyFormat("x = x as {a: string};");
+ verifyFormat("x = x as (string);");
}
TEST_F(FormatTestJS, TypeArguments) {
OpenPOWER on IntegriCloud