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

Side by Side Diff: tests/corelib/map_test.dart

Issue 836123002: Don't inherit two versions of Comparable. Not supported by dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library map_test; 5 library map_test;
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert' show JSON; 8 import 'dart:convert' show JSON;
9 9
10 Map newJsonMap() 10 Map newJsonMap()
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 int index = _keys.indexOf(key); 896 int index = _keys.indexOf(key);
897 if (index < 0) return null; 897 if (index < 0) return null;
898 return _values[index]; 898 return _values[index];
899 } 899 }
900 900
901 Iterable<K> get keys => _keys.skip(0); 901 Iterable<K> get keys => _keys.skip(0);
902 } 902 }
903 903
904 abstract class Super implements Comparable {} 904 abstract class Super implements Comparable {}
905 abstract class Interface implements Comparable {} 905 abstract class Interface implements Comparable {}
906 class Sub extends Super implements Interface, Comparable<Sub> { 906 class Sub extends Super implements Interface, Comparable {
907 int compareTo(Sub other) => 0; 907 int compareTo(Sub other) => 0;
908 int get hashCode => 0; 908 int get hashCode => 0;
909 bool operator==(Object other) => other is Sub; 909 bool operator==(other) => other is Sub;
910 } 910 }
911 911
912 expectMap(Map expect, Map actual) { 912 expectMap(Map expect, Map actual) {
913 Expect.equals(expect.length, actual.length, "length"); 913 Expect.equals(expect.length, actual.length, "length");
914 for (var key in expect.keys) { 914 for (var key in expect.keys) {
915 Expect.isTrue(actual.containsKey(key), "containsKey $key"); 915 Expect.isTrue(actual.containsKey(key), "containsKey $key");
916 Expect.equals(expect[key], actual[key]); 916 Expect.equals(expect[key], actual[key]);
917 } 917 }
918 } 918 }
919 919
(...skipping 22 matching lines...) Expand all
942 Map<Interface, Interface> interfaceMap = <Interface, Interface>{sub: sub}; 942 Map<Interface, Interface> interfaceMap = <Interface, Interface>{sub: sub};
943 expectMap(superMap, new Map<Super, Super>.from(interfaceMap)); 943 expectMap(superMap, new Map<Super, Super>.from(interfaceMap));
944 expectMap(superMap, new Map<Interface, Interface>.from(superMap)); 944 expectMap(superMap, new Map<Interface, Interface>.from(superMap));
945 expectMap(superMap, new HashMap<Super, Super>.from(interfaceMap)); 945 expectMap(superMap, new HashMap<Super, Super>.from(interfaceMap));
946 expectMap(superMap, new HashMap<Interface, Interface>.from(superMap)); 946 expectMap(superMap, new HashMap<Interface, Interface>.from(superMap));
947 expectMap(superMap, new LinkedHashMap<Super, Super>.from(interfaceMap)); 947 expectMap(superMap, new LinkedHashMap<Super, Super>.from(interfaceMap));
948 expectMap(superMap, new LinkedHashMap<Interface, Interface>.from(superMap)); 948 expectMap(superMap, new LinkedHashMap<Interface, Interface>.from(superMap));
949 expectMap(superMap, new SplayTreeMap<Super, Super>.from(interfaceMap)); 949 expectMap(superMap, new SplayTreeMap<Super, Super>.from(interfaceMap));
950 expectMap(superMap, new SplayTreeMap<Interface, Interface>.from(superMap)); 950 expectMap(superMap, new SplayTreeMap<Interface, Interface>.from(superMap));
951 } 951 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698