OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import 'package:unittest/unittest.dart'; |
| 6 |
| 7 thrower() async { |
| 8 throw 'oops'; |
| 9 } |
| 10 |
| 11 number() async { |
| 12 return 4; |
| 13 } |
| 14 |
| 15 generator() async* { |
| 16 yield await number(); |
| 17 yield await thrower(); |
| 18 } |
| 19 |
| 20 foo() async { |
| 21 await for (var i in generator()) { |
| 22 print(i); |
| 23 } |
| 24 } |
| 25 |
| 26 main() async { |
| 27 try { |
| 28 await foo(); |
| 29 } catch (e, st) { |
| 30 expect(st.toString(), stringContainsInOrder([ |
| 31 'thrower.<thrower_async_body>', |
| 32 '<asynchronous suspension>', |
| 33 'thrower', |
| 34 'generator.<generator_async_gen_body>', |
| 35 '<asynchronous suspension>', |
| 36 'generator', |
| 37 'foo.<foo_async_body>', |
| 38 '<asynchronous suspension>', |
| 39 ])); |
| 40 } |
| 41 } |
OLD | NEW |