diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 56b493dae1c..cba2ce3370c 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -962,6 +962,14 @@ TEST_F(FormatTestJS, TypeArguments) { " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa {}"); } +TEST_F(FormatTestJS, UserDefinedTypeGuards) { + verifyFormat( + "function foo(check: Object):\n" + " check is {foo: string, bar: string, baz: string, foobar: string} {\n" + " return 'bar' in check;\n" + "}\n"); +} + TEST_F(FormatTestJS, OptionalTypes) { verifyFormat("function x(a?: b, c?, d?) {}"); verifyFormat("class X {\n" |