| Index: tests/isolate/illegal_msg_stream_test.dart
|
| diff --git a/tests/isolate/illegal_msg_test.dart b/tests/isolate/illegal_msg_stream_test.dart
|
| similarity index 51%
|
| copy from tests/isolate/illegal_msg_test.dart
|
| copy to tests/isolate/illegal_msg_stream_test.dart
|
| index 51b442ccdc8a6bd612039a2bf568daed62c1bca4..b9e0a0d21603317d062beed3ff5a30bb2ba91213 100644
|
| --- a/tests/isolate/illegal_msg_test.dart
|
| +++ b/tests/isolate/illegal_msg_stream_test.dart
|
| @@ -2,32 +2,31 @@
|
| // 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.
|
|
|
| -library illegal_msg_tests;
|
| import 'dart:isolate';
|
|
|
| funcFoo(x) => x + 2;
|
|
|
| -echo() {
|
| - port.receive((msg, reply) {
|
| - reply.send("echoing ${msg(1)}}");
|
| +foo() {
|
| + stream.single.then((msg) {
|
| + IsolateSink sink = msg;
|
| + sink.add(499);
|
| + sink.close();
|
| });
|
| }
|
|
|
| main() {
|
| - var snd = spawnFunction(echo);
|
| + var box = new MessageBox();
|
| + var snd = streamSpawnFunction(foo);
|
| var caught_exception = false;
|
| try {
|
| - snd.send(funcFoo, port.toSendPort());
|
| + snd.add(funcFoo);
|
| } catch (e) {
|
| caught_exception = true;
|
| }
|
| + snd.add(box.sink);
|
| + snd.close();
|
|
|
| - if (caught_exception) {
|
| - port.close();
|
| - } else {
|
| - port.receive((msg, reply) {
|
| - print("from worker ${msg}");
|
| - });
|
| - }
|
| - Expect.isTrue(caught_exception);
|
| + box.stream.single.then((msg) {
|
| + Expect.equals(499, msg);
|
| + });
|
| }
|
|
|