Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 import 'package:unittest/unittest.dart'; | 5 import 'package:unittest/unittest.dart'; |
| 6 | 6 |
| 7 thrower() async { | 7 thrower() async { |
| 8 throw 'oops'; | 8 throw 'oops'; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 await for (var i in generator()) { | 21 await for (var i in generator()) { |
| 22 print(i); | 22 print(i); |
| 23 } | 23 } |
| 24 } | 24 } |
| 25 | 25 |
| 26 main() async { | 26 main() async { |
| 27 try { | 27 try { |
| 28 await foo(); | 28 await foo(); |
| 29 } catch (e, st) { | 29 } catch (e, st) { |
| 30 expect(st.toString(), stringContainsInOrder([ | 30 expect(st.toString(), stringContainsInOrder([ |
| 31 'thrower.<thrower_async_body>', | |
| 32 '<asynchronous suspension>', | |
| 33 'thrower', | 31 'thrower', |
| 34 'generator.<generator_async_gen_body>', | |
| 35 '<asynchronous suspension>', | 32 '<asynchronous suspension>', |
| 36 'generator', | 33 'generator', |
| 37 'foo.<foo_async_body>', | |
| 38 '<asynchronous suspension>', | 34 '<asynchronous suspension>', |
| 35 'foo', | |
| 36 '<asynchronous suspension>', | |
| 37 'main', | |
| 39 ])); | 38 ])); |
|
siva
2017/02/11 00:24:33
might be interesting to add
try {
a
Cutch
2017/02/11 01:14:28
Done.
| |
| 40 } | 39 } |
| 40 | |
| 41 inner() async { | |
| 42 deep() async { | |
| 43 await thrower(); | |
| 44 } | |
| 45 await deep(); | |
| 46 } | |
| 47 | |
| 48 try { | |
| 49 await inner(); | |
| 50 } catch (e, st) { | |
| 51 expect(st.toString(), stringContainsInOrder([ | |
| 52 'thrower', | |
| 53 '<asynchronous suspension>', | |
| 54 'main.inner.deep', | |
| 55 '<asynchronous suspension>', | |
| 56 'main.inner', | |
| 57 '<asynchronous suspension>', | |
| 58 'main', | |
| 59 '<asynchronous suspension>', | |
| 60 ])); | |
| 61 } | |
| 41 } | 62 } |
| OLD | NEW |