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

Unified Diff: pkg/json/test/json_test.dart

Issue 224403005: pkg/json: deprecate encoding APIs - encourage usage of dart:convert instead (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « pkg/json/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json/test/json_test.dart
diff --git a/pkg/json/test/json_test.dart b/pkg/json/test/json_test.dart
index c3aaf7028b89d3d1bd81a2c10efd17bf1def1580..e61d4cd105a405c20b50629b0a3d7c49eca3bd8b 100644
--- a/pkg/json/test/json_test.dart
+++ b/pkg/json/test/json_test.dart
@@ -81,9 +81,8 @@ main() {
expect(json.stringify(null), equals('null'));
expect(json.stringify(' hi there" bob '), equals('" hi there\\" bob "'));
expect(json.stringify('hi\\there'), equals('"hi\\\\there"'));
- // TODO(devoncarew): these tests break the dartium build
- //expect(json.stringify('hi\nthere'), equals('"hi\\nthere"'));
- //expect(json.stringify('hi\r\nthere'), equals('"hi\\r\\nthere"'));
+ expect(json.stringify('hi\nthere'), equals('"hi\\nthere"'));
+ expect(json.stringify('hi\r\nthere'), equals('"hi\\r\\nthere"'));
expect(json.stringify(''), equals('""'));
// Lists.
@@ -163,6 +162,14 @@ main() {
a.add(b);
expect(() => json.stringify(a), throwsJsonError);
});
+
+ test('print on', () {
+ var obj = { 'a': 'a', 'b': 2, 'c': [1,2,3]};
+ var output = json.stringify(obj);
+ var sb = new StringBuffer();
+ json.printOn(obj, sb);
+ expect(sb.toString(), output);
+ });
}
class TestClass {
« no previous file with comments | « pkg/json/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698