1// Copyright 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5import 'dart:async'; 6 7import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; 8 9/// Verifies Dart semantics governed by flags set by Flutter tooling. 10void main() { 11 group('Async', () { 12 String greeting = 'hello'; 13 Future<void> changeGreeting() async { 14 greeting += ' 1'; 15 await Future<void>.value(null); 16 greeting += ' 2'; 17 } 18 test('execution of async method starts synchronously', () async { 19 expect(greeting, 'hello'); 20 final Future<void> future = changeGreeting(); 21 expect(greeting, 'hello 1'); 22 await future; 23 expect(greeting, 'hello 1 2'); 24 }); 25 }); 26} 27