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

Unified Diff: tests/lib/convert/json_test.dart

Issue 387323002: Fix error message for unexpected characters in JSON. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Actually fix the problem, using existing variables. Created 6 years, 5 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 | « runtime/lib/convert_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/json_test.dart
diff --git a/tests/lib/convert/json_test.dart b/tests/lib/convert/json_test.dart
index 2d3e084e139b80f3e5560675ed142e1f2bb4b76a..e1bc6b29776ed97277c1c09f3aef48392a5348e7 100644
--- a/tests/lib/convert/json_test.dart
+++ b/tests/lib/convert/json_test.dart
@@ -34,14 +34,15 @@ void testJson(json, expected) {
}
}
for (var reviver in [null, (k, v) => v]) {
+ var name = (reviver == null) ? "" : "reviver:";
var value = JSON.decode(json, reviver: reviver);
- compare(expected, value, "$value");
+ compare(expected, value, "$name$value");
value = JSON.decode(" $json ", reviver: reviver);
- compare(expected, value, "-$value-");
+ compare(expected, value, "$name-$value-");
value = JSON.decode("[$json]", reviver: reviver);
- compare([expected], value, "[$value]");
+ compare([expected], value, "$name[$value]");
value = JSON.decode('{"x":$json}', reviver: reviver);
- compare({"x":expected}, value, "{x:$value}");
+ compare({"x":expected}, value, "$name{x:$value}");
}
}
« no previous file with comments | « runtime/lib/convert_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698