summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index ba0700edd4f..5a71f003371 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -2308,5 +2308,14 @@ TEST_F(FormatTestJS, ParameterNamingComment) {
verifyFormat("callFoo(/*spaceAfterParameterNamingComment=*/ 1);");
}
+TEST_F(FormatTestJS, ConditionalTypes) {
+ // Formatting below is not necessarily intentional, this just ensures that
+ // clang-format does not break the code.
+ verifyFormat( // wrap
+ "type UnionToIntersection<U> =\n"
+ " (U extends any ? (k: U) => void :\n"
+ " never) extends((k: infer I) => void) ? I : never;");
+}
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud