| Index: tests/language/vm/causal_async_exception_stack_test.dart
|
| diff --git a/tests/language/vm/causal_async_exception_stack_test.dart b/tests/language/vm/causal_async_exception_stack_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5e8eee0061fb72b969dfb62e854af83bdae0f8a2
|
| --- /dev/null
|
| +++ b/tests/language/vm/causal_async_exception_stack_test.dart
|
| @@ -0,0 +1,41 @@
|
| +// Copyright (c) 2016, 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.
|
| +
|
| +import 'package:unittest/unittest.dart';
|
| +
|
| +thrower() async {
|
| + throw 'oops';
|
| +}
|
| +
|
| +number() async {
|
| + return 4;
|
| +}
|
| +
|
| +generator() async* {
|
| + yield await number();
|
| + yield await thrower();
|
| +}
|
| +
|
| +foo() async {
|
| + await for (var i in generator()) {
|
| + print(i);
|
| + }
|
| +}
|
| +
|
| +main() async {
|
| + try {
|
| + await foo();
|
| + } catch (e, st) {
|
| + expect(st.toString(), stringContainsInOrder([
|
| + 'thrower.<thrower_async_body>',
|
| + '<asynchronous suspension>',
|
| + 'thrower',
|
| + 'generator.<generator_async_gen_body>',
|
| + '<asynchronous suspension>',
|
| + 'generator',
|
| + 'foo.<foo_async_body>',
|
| + '<asynchronous suspension>',
|
| + ]));
|
| + }
|
| +}
|
|
|