summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:45 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:45 +0000
commit570918821a8492048e6ab54955c9864bd6c3e952 (patch)
treef9d0d3f3478c298aaf51987483bbbbefe8e6631b /unittests/Format/FormatTestJS.cpp
parentf0c55418e2b09eaab37c820d3756cc1b4584d084 (diff)
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r--unittests/Format/FormatTestJS.cpp17
1 files changed, 17 insertions, 0 deletions
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"