diff options
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) { |

