From be10a2c39151cee56ec32efb9644d736faaba334 Mon Sep 17 00:00:00 2001
From: Nate Bosch <nbosch1@gmail.com>
Date: Thu, 7 Jun 2018 17:24:18 -0700
Subject: [PATCH] Avoid `Future.sync` wrapping an async method (#855)

---
 test/frontend/expect_async_test.dart | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/test/frontend/expect_async_test.dart b/test/frontend/expect_async_test.dart
index e42dc6b9..84f55f10 100644
--- a/test/frontend/expect_async_test.dart
+++ b/test/frontend/expect_async_test.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'dart:async';
-
 import 'package:test/src/backend/state.dart';
 import 'package:test/test.dart';
 
@@ -172,7 +170,7 @@ void main() {
       liveTest = createTest(() {
         var callback = expectAsync0(() {}, count: 3);
 
-        future = new Future.sync(() async {
+        future = () async {
           await pumpEventQueue();
           expect(liveTest.state.status, equals(Status.running));
           callback();
@@ -184,7 +182,7 @@ void main() {
           await pumpEventQueue();
           expect(liveTest.state.status, equals(Status.running));
           callback();
-        });
+        }();
       });
 
       await liveTest.run();
@@ -272,7 +270,7 @@ void main() {
         var done = false;
         var callback = expectAsyncUntil0(() {}, () => done);
 
-        future = new Future.sync(() async {
+        future = () async {
           await pumpEventQueue();
           expect(liveTest.state.status, equals(Status.running));
           callback();
@@ -280,7 +278,7 @@ void main() {
           expect(liveTest.state.status, equals(Status.running));
           done = true;
           callback();
-        });
+        }();
       });
 
       await liveTest.run();
-- 
GitLab