2015-03-06 02:57:34 +00:00
|
|
|
// Copyright (c) 2014, 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:expect/expect.dart';
|
2015-11-25 22:33:09 +00:00
|
|
|
import 'package:async_helper/async_helper.dart';
|
2015-03-06 02:57:34 +00:00
|
|
|
import "dart:isolate";
|
|
|
|
|
|
|
|
enum Foo { BAR, BAZ }
|
|
|
|
|
|
|
|
main() {
|
|
|
|
var p;
|
|
|
|
p = new RawReceivePort((map) {
|
|
|
|
Expect.equals(1, map.keys.length);
|
|
|
|
Expect.equals(42, map.values.first);
|
|
|
|
var key = map.keys.first;
|
|
|
|
Expect.equals(42, map[key]);
|
|
|
|
p.close();
|
|
|
|
});
|
2015-11-25 22:33:09 +00:00
|
|
|
asyncStart();
|
|
|
|
Isolate.spawn(sendIt, p.sendPort).whenComplete(asyncEnd);
|
2015-03-06 02:57:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void sendIt(port) {
|
|
|
|
var map = { Foo.BAR: 42 };
|
|
|
|
port.send(map);
|
|
|
|
}
|