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

Unified Diff: tests/corelib/map_test.dart

Issue 367683002: Use JsonMap even for JSON.decode with custom reviver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long line in test. Created 6 years, 6 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
« no previous file with comments | « tests/corelib/json_map_test.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 6b03a1dc4b37d46d21fb176edcf9c38ff752be8d..a14f0a59cb5b3b8e907b09194e585ae95a6af266 100644
--- a/tests/corelib/map_test.dart
+++ b/tests/corelib/map_test.dart
@@ -7,7 +7,10 @@ import "package:expect/expect.dart";
import 'dart:collection';
import 'dart:convert' show JSON;
-Map newJsonMap() => JSON.decode('{}');
+Map newJsonMap()
+ => JSON.decode('{}');
+Map newJsonMapCustomReviver()
+ => JSON.decode('{}', reviver: (key, value) => value);
void main() {
test(new HashMap());
@@ -19,6 +22,7 @@ void main() {
test(new MapBaseMap());
test(new MapMixinMap());
test(newJsonMap());
+ test(newJsonMapCustomReviver());
testLinkedHashMap();
testMapLiteral();
testNullValue();
@@ -35,6 +39,7 @@ void main() {
testWeirdStringKeys(new MapBaseMap<String, String>());
testWeirdStringKeys(new MapMixinMap<String, String>());
testWeirdStringKeys(newJsonMap());
+ testWeirdStringKeys(newJsonMapCustomReviver());
testNumericKeys(new Map());
testNumericKeys(new Map<num, String>());
@@ -49,6 +54,7 @@ void main() {
testNumericKeys(new MapBaseMap<num, String>());
testNumericKeys(new MapMixinMap<num, String>());
testNumericKeys(newJsonMap());
+ testNumericKeys(newJsonMapCustomReviver());
testNaNKeys(new Map());
testNaNKeys(new Map<num, String>());
@@ -59,6 +65,7 @@ void main() {
testNaNKeys(new MapBaseMap<num, String>());
testNaNKeys(new MapMixinMap<num, String>());
testNaNKeys(newJsonMap());
+ testNaNKeys(newJsonMapCustomReviver());
// Identity maps fail the NaN-keys tests because the test assumes that
// NaN is not equal to NaN.
@@ -87,6 +94,7 @@ void main() {
testIterationOrder(new LinkedHashMap());
testIterationOrder(new LinkedHashMap.identity());
testIterationOrder(newJsonMap());
+ testIterationOrder(newJsonMapCustomReviver());
testOtherKeys(new SplayTreeMap<int, int>());
testOtherKeys(new SplayTreeMap<int, int>((int a, int b) => a - b,
@@ -110,6 +118,7 @@ void main() {
testOtherKeys(new MapBaseMap<int, int>());
testOtherKeys(new MapMixinMap<int, int>());
testOtherKeys(newJsonMap());
+ testOtherKeys(newJsonMapCustomReviver());
testUnmodifiableMap(const {1 : 37});
testUnmodifiableMap(new UnmodifiableMapView({1 : 37}));
« no previous file with comments | « tests/corelib/json_map_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698