Files
sdk/tests/lib_2/isolate/message_enum_test.dart
T
Ben Konyi d932b15c0d Migrated test block 33 to Dart 2.0.
Bug:
Change-Id: Ifb1626e45868c1bfc626edd83c7d9db5680764ed
Reviewed-on: https://dart-review.googlesource.com/11246
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2017-10-05 21:04:03 +00:00

28 lines
711 B
Dart

// 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';
import 'package:async_helper/async_helper.dart';
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();
});
asyncStart();
Isolate.spawn(sendIt, p.sendPort).whenComplete(asyncEnd);
}
void sendIt(port) {
var map = {Foo.BAR: 42};
port.send(map);
}