diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 7fad83aab12..e08c876a5c6 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -595,6 +595,8 @@ TEST_F(FormatTestJS, ReturnStatements) { TEST_F(FormatTestJS, ForLoops) { verifyFormat("for (var i in [2, 3]) {\n" "}"); + verifyFormat("for (var i of [2, 3]) {\n" + "}"); } TEST_F(FormatTestJS, AutomaticSemicolonInsertion) { @@ -758,6 +760,7 @@ TEST_F(FormatTestJS, TypeAnnotations) { verifyFormat("function x(): {x: string} {\n return {x: 'x'};\n}"); verifyFormat("function x(y: string): string {\n return 'x';\n}"); verifyFormat("for (var y: string in x) {\n x();\n}"); + verifyFormat("for (var y: string of x) {\n x();\n}"); verifyFormat("function x(y: {a?: number;} = {}): number {\n" " return 12;\n" "}"); |