From 570918821a8492048e6ab54955c9864bd6c3e952 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 2 May 2017 18:30:45 +0000 Subject: Vendor import of clang trunk r301939: https://llvm.org/svn/llvm-project/cfe/trunk@301939 --- unittests/Format/FormatTestJS.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'unittests/Format/FormatTestJS.cpp') diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index 7886c4fe27ad8..eda9e0a31da46 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -485,6 +485,20 @@ TEST_F(FormatTestJS, AsyncFunctions) { " let x = 1;\n" " return fetch(x);\n" "}"); + verifyFormat("async function f() {\n" + " return 1;\n" + "}\n" + "\n" + "function a() {\n" + " return 1;\n" + "}\n", + " async function f() {\n" + " return 1;\n" + "}\n" + "\n" + " function a() {\n" + " return 1;\n" + "} \n"); verifyFormat("async function* f() {\n" " yield fetch(x);\n" "}"); @@ -492,6 +506,9 @@ TEST_F(FormatTestJS, AsyncFunctions) { " return fetch(x);\n" "}"); verifyFormat("let x = async () => f();"); + verifyFormat("let x = async function() {\n" + " f();\n" + "};"); verifyFormat("let x = async();"); verifyFormat("class X {\n" " async asyncMethod() {\n" -- cgit v1.2.3