diff options
| author | Martin Probst <martin@probst.io> | 2016-06-23 19:52:32 +0000 |
|---|---|---|
| committer | Martin Probst <martin@probst.io> | 2016-06-23 19:52:32 +0000 |
| commit | 1b7f98042de25731eae42ff220bf423efb5b669f (patch) | |
| tree | eca6339b03b943c0fec39f3a760a50d37ecf6f3f /clang/unittests/Format/FormatTestJS.cpp | |
| parent | b130fe7d316efb01870e99912d58ea7c5a11a329 (diff) | |
| download | bcm5719-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.cpp | 6 |
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) { |

