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

Unified Diff: tests/corelib/map_test.dart

Issue 24267023: Update implementations to use Object.identityHashCode for identity map/set (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« sdk/lib/collection/hash_map.dart ('K') | « sdk/lib/core/set.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/map_test.dart
diff --git a/tests/corelib/map_test.dart b/tests/corelib/map_test.dart
index 7e9d50db7707428403e4492518360a2ad988bc9f..a6db042d42f5ad92b8ba8b434c915b531496c5a6 100644
--- a/tests/corelib/map_test.dart
+++ b/tests/corelib/map_test.dart
@@ -29,12 +29,12 @@ void main() {
testNumericKeys(new Map<num, String>());
testNumericKeys(new HashMap());
testNumericKeys(new HashMap<num, String>());
- testNumericKeys(new HashMap(equals: identical));
- testNumericKeys(new HashMap<num, String>(equals: identical));
+ testNumericKeys(new HashMap.identity());
+ testNumericKeys(new HashMap<num, String>.identity());
testNumericKeys(new LinkedHashMap());
testNumericKeys(new LinkedHashMap<num, String>());
- testNumericKeys(new LinkedHashMap(equals: identical));
- testNumericKeys(new LinkedHashMap<num, String>(equals: identical));
+ testNumericKeys(new LinkedHashMap.identity());
+ testNumericKeys(new LinkedHashMap<num, String>.identity());
testNaNKeys(new Map());
testNaNKeys(new Map<num, String>());
@@ -45,8 +45,13 @@ void main() {
// Identity maps fail the NaN-keys tests because the test assumes that
// NaN is not equal to NaN.
- testIdentityMap(new HashMap(equals: identical));
- testIdentityMap(new LinkedHashMap(equals: identical));
+ testIdentityMap(new Map.identity());
+ testIdentityMap(new HashMap.identity());
+ testIdentityMap(new LinkedHashMap.identity());
+ testIdentityMap(new HashMap(equals: identical,
+ hashCode: Object.identityHashCode));
+ testIdentityMap(new LinkedHashMap(equals: identical,
+ hashCode: Object.identityHashCode));
testCustomMap(new HashMap(equals: myEquals, hashCode: myHashCode,
isValidKey: (v) => v is Customer));
@@ -59,7 +64,7 @@ void main() {
hashCode: myHashCode));
testIterationOrder(new LinkedHashMap());
- testIterationOrder(new LinkedHashMap(equals: identical));
+ testIterationOrder(new LinkedHashMap.identity());
testOtherKeys(new SplayTreeMap<int, int>());
testOtherKeys(new SplayTreeMap<int, int>((int a, int b) => a - b,
@@ -67,14 +72,14 @@ void main() {
testOtherKeys(new SplayTreeMap((int a, int b) => a - b,
(v) => v is int));
testOtherKeys(new HashMap<int, int>());
- testOtherKeys(new HashMap<int, int>(equals: identical));
+ testOtherKeys(new HashMap<int, int>.identity());
testOtherKeys(new HashMap<int, int>(hashCode: (v) => v.hashCode,
isValidKey: (v) => v is int));
testOtherKeys(new HashMap(equals: (int x, int y) => x == y,
hashCode: (int v) => v.hashCode,
isValidKey: (v) => v is int));
testOtherKeys(new LinkedHashMap<int, int>());
- testOtherKeys(new LinkedHashMap<int, int>(equals: identical));
+ testOtherKeys(new LinkedHashMap<int, int>.identity());
testOtherKeys(new LinkedHashMap<int, int>(hashCode: (v) => v.hashCode,
isValidKey: (v) => v is int));
testOtherKeys(new LinkedHashMap(equals: (int x, int y) => x == y,
« sdk/lib/collection/hash_map.dart ('K') | « sdk/lib/core/set.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698