Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: tests/isolate/message_enum_test.dart

Issue 752123003: Support enum keys in maps in messages. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/message_enum_test.dart
===================================================================
--- tests/isolate/message_enum_test.dart (revision 0)
+++ tests/isolate/message_enum_test.dart (working copy)
@@ -0,0 +1,27 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
siva 2015/03/05 23:42:07 A new file so use 2015.
koda 2015/03/06 01:43:04 I actually wrote it in 2014 :)
+// 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.
+
+// SharedOptions=--enable-enum
+
+import 'package:expect/expect.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();
+ });
+ Isolate.spawn(sendIt, p.sendPort);
+}
+
+void sendIt(port) {
+ var map = { Foo.BAR: 42 };
+ port.send(map);
+}
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698