Chromium Code Reviews| Index: isolate/illegal_msg_negative_test.dart |
| =================================================================== |
| --- isolate/illegal_msg_negative_test.dart (revision 0) |
| +++ isolate/illegal_msg_negative_test.dart (revision 0) |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2012, 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 'dart:isolate'; |
| + |
| +funcFoo(x) => x + 2; |
| + |
| +echo() { |
| + port.receive((msg, reply) { |
| + reply.send("echoing ${msg(1)}}"); |
| + }); |
| +} |
| + |
| +main() { |
| + var snd = spawnFunction(echo); |
| + snd.send(funcFoo, port.toSendPort()); |
|
Ivan Posva
2012/11/08 03:45:32
The goal was to get away from negative tests. Is i
siva
2012/11/08 17:05:58
Made it a positive test by catching the exception
|
| + |
| + port.receive((msg, reply) { |
| + print("from worker ${msg}"); |
| + }); |
| +} |