OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library async_await_test; | 5 library async_await_test; |
6 | 6 |
7 // Use of package:unittest and package:test is deprecated in sdk/tests. | 7 import "package:test/test.dart"; |
8 // Do not add any more uses of this package. | |
9 import "package:unittest/unittest.dart"; | |
10 import "dart:async"; | 8 import "dart:async"; |
11 | 9 |
12 main() { | 10 main() { |
13 bool checkedMode = false; | 11 bool checkedMode = false; |
14 assert((checkedMode = true)); | 12 assert((checkedMode = true)); |
15 | 13 |
16 group("basic", () { | 14 group("basic", () { |
17 test("async w/o await", () { | 15 test("async w/o await", () { |
18 f() async { return id(42); } | 16 f() async { return id(42); } |
19 return expect42(f()); | 17 return expect42(f()); |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2001 if (onError is BinaryFunction) { | 1999 if (onError is BinaryFunction) { |
2002 return onError(_error, null); | 2000 return onError(_error, null); |
2003 } | 2001 } |
2004 return onError(_error); | 2002 return onError(_error); |
2005 }); | 2003 }); |
2006 } | 2004 } |
2007 Stream asStream() => | 2005 Stream asStream() => |
2008 (new StreamController()..addError(_error)..close()).stream; | 2006 (new StreamController()..addError(_error)..close()).stream; |
2009 Future timeout(Duration duration, {onTimeout}) => this; | 2007 Future timeout(Duration duration, {onTimeout}) => this; |
2010 } | 2008 } |
OLD | NEW |