| 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 import "package:test/test.dart"; | 7 // Use of package:unittest and package:test is deprecated in sdk/tests. |
| 8 // Do not add any more uses of this package. |
| 9 import "package:unittest/unittest.dart"; |
| 8 import "dart:async"; | 10 import "dart:async"; |
| 9 | 11 |
| 10 main() { | 12 main() { |
| 11 bool checkedMode = false; | 13 bool checkedMode = false; |
| 12 assert((checkedMode = true)); | 14 assert((checkedMode = true)); |
| 13 | 15 |
| 14 group("basic", () { | 16 group("basic", () { |
| 15 test("async w/o await", () { | 17 test("async w/o await", () { |
| 16 f() async { return id(42); } | 18 f() async { return id(42); } |
| 17 return expect42(f()); | 19 return expect42(f()); |
| (...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 if (onError is BinaryFunction) { | 2001 if (onError is BinaryFunction) { |
| 2000 return onError(_error, null); | 2002 return onError(_error, null); |
| 2001 } | 2003 } |
| 2002 return onError(_error); | 2004 return onError(_error); |
| 2003 }); | 2005 }); |
| 2004 } | 2006 } |
| 2005 Stream asStream() => | 2007 Stream asStream() => |
| 2006 (new StreamController()..addError(_error)..close()).stream; | 2008 (new StreamController()..addError(_error)..close()).stream; |
| 2007 Future timeout(Duration duration, {onTimeout}) => this; | 2009 Future timeout(Duration duration, {onTimeout}) => this; |
| 2008 } | 2010 } |
| OLD | NEW |