mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 22:01:19 +00:00
7b0bc3d220
BUG= R=floitsch@google.com, johnniwinther@google.com Review URL: https://codereview.chromium.org//839323003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43591 260f80e4-7a28-3924-810f-c04153c831b5
22 lines
537 B
Dart
22 lines
537 B
Dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// 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.
|
|
|
|
// Test that an async function does not start immediately.
|
|
|
|
import "package:expect/expect.dart";
|
|
import "package:async_helper/async_helper.dart";
|
|
|
|
var x = 0;
|
|
|
|
foo() async {
|
|
x++;
|
|
await 1;
|
|
x++;
|
|
}
|
|
|
|
void main() {
|
|
asyncStart();
|
|
foo().then((_) => Expect.equals(2, x)).whenComplete(asyncEnd);
|
|
Expect.equals(0, x);
|
|
} |