summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-06-23 19:52:32 +0000
committerMartin Probst <martin@probst.io>2016-06-23 19:52:32 +0000
commit1b7f98042de25731eae42ff220bf423efb5b669f (patch)
treeeca6339b03b943c0fec39f3a760a50d37ecf6f3f /clang/unittests/Format/FormatTestJS.cpp
parentb130fe7d316efb01870e99912d58ea7c5a11a329 (diff)
downloadbcm5719-llvm-1b7f98042de25731eae42ff220bf423efb5b669f.tar.gz
bcm5719-llvm-1b7f98042de25731eae42ff220bf423efb5b669f.zip
clang-format: [JS] recognize more type locations.
Summary: Includes parenthesized type expressions and type aliases. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D21597 llvm-svn: 273603
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 4feb55dae24..bd5a505d59e 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -914,6 +914,12 @@ TEST_F(FormatTestJS, UnionIntersectionTypes) {
verifyFormat("function(x: A|B = A | B): C&D {}");
verifyFormat("function x(path: number|string) {}");
verifyFormat("function x(): string|number {}");
+ verifyFormat("type Foo = Bar|Baz;");
+ verifyFormat("type Foo = Bar<X>|Baz;");
+ verifyFormat("type Foo = (Bar<X>|Baz);");
+ verifyFormat("let x: Bar|Baz;");
+ verifyFormat("let x: Bar<X>|Baz;");
+ verifyFormat("let x: (Foo|Bar)[];");
}
TEST_F(FormatTestJS, ClassDeclarations) {
OpenPOWER on IntegriCloud