Skip to content

Commit 439c808

Browse files
authored
Fixes #1376. Broken co19_2 test fixed (#1377)
Authored by @sgrekhov.
1 parent 50964b2 commit 439c808

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Language/Statements/For/Asynchronous_For_in/execution_t04.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ Future test2() async {
6868

6969
// try an already closed single subscription stream
7070
Future test3() async {
71-
// make a stream that is closed
72-
Stream stream = new Stream.fromIterable([1, 2]);
73-
await for (var x in stream) {
71+
Stream<int> generator() async* {
72+
yield 42;
73+
}
74+
Stream stream = generator();
75+
await for (var i in stream) {
7476
}
7577
var processedValues = [];
7678
try {
@@ -87,7 +89,6 @@ Future test3() async {
8789
Expect.isTrue(processedValues.isEmpty);
8890
}
8991

90-
9192
main() {
9293
asyncStart();
9394
Future.wait([test1(), test2(), test3()]).then((v) => asyncEnd());

0 commit comments

Comments
 (0)