| Index: tests/language/async_regression_23058_test.dart
|
| diff --git a/tests/language/asyncstar_concat_test.dart b/tests/language/async_regression_23058_test.dart
|
| similarity index 55%
|
| copy from tests/language/asyncstar_concat_test.dart
|
| copy to tests/language/async_regression_23058_test.dart
|
| index aeb1361cd85fdcc35bf1fd466b161c2462befc4e..ebec58efedf54b43e86d75280ad8beae914338e4 100644
|
| --- a/tests/language/asyncstar_concat_test.dart
|
| +++ b/tests/language/async_regression_23058_test.dart
|
| @@ -2,28 +2,35 @@
|
| // 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.
|
|
|
| +// Regression test for issue 23058.
|
| +
|
| import "package:expect/expect.dart";
|
| import "package:async_helper/async_helper.dart";
|
|
|
| -range(start, end) async* {
|
| - for (int i = start; i < end; i++) {
|
| - yield i;
|
| +class A {
|
| + var x = new B();
|
| +
|
| + foo() async {
|
| + return x.foo == 2 ? 42 : x.foo;
|
| }
|
| }
|
|
|
| -concat(a, b) async* {
|
| - yield* a;
|
| - yield* b;
|
| -}
|
| +class B {
|
| + var x = 0;
|
|
|
| -test() async {
|
| - Expect.listEquals([1, 2, 3, 11, 12, 13],
|
| - await concat(range(1, 4), range(11, 14)).toList());
|
| + get foo {
|
| + if (x == -1) {
|
| + return 0;
|
| + } else {
|
| + return x++;
|
| + }
|
| + }
|
| }
|
|
|
| main() {
|
| asyncStart();
|
| - test().then((_) {
|
| + new A().foo().then((result) {
|
| + Expect.equals(1, result);
|
| asyncEnd();
|
| });
|
| }
|
|
|