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

Unified Diff: tests/json/json_test.dart

Issue 10579008: Added test setup/teardown. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « lib/unittest/unittest.dart ('k') | tests/lib/unittest/matchers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/json/json_test.dart
===================================================================
--- tests/json/json_test.dart (revision 8913)
+++ tests/json/json_test.dart (working copy)
@@ -28,54 +28,48 @@
expect(JSON.parse(' [] '), isEmpty);
expect(JSON.parse('[ ]'), isEmpty);
expect(JSON.parse(' [3, -4.5, true, "hi", false] '),
- orderedEquals([3, -4.5, true, 'hi', false]));
+ equals([3, -4.5, true, 'hi', false]));
// Nulls are tricky.
expect(JSON.parse('[null]'), orderedEquals([null]));
expect(JSON.parse(' [3, -4.5, null, true, "hi", false] '),
- orderedEquals([3, -4.5, null, true, 'hi', false]));
- expect(JSON.parse('[[null]]'),
- recursivelyMatches([[null]]));
+ equals([3, -4.5, null, true, 'hi', false]));
+ expect(JSON.parse('[[null]]'), equals([[null]]));
expect(JSON.parse(' [ [3], [], [null], ["hi", true]] '),
- recursivelyMatches([[3], [], [null], ['hi', true]]));
+ equals([[3], [], [null], ['hi', true]]));
// Maps.
expect(JSON.parse(' {} '), isEmpty);
expect(JSON.parse('{ }'), isEmpty);
expect(JSON.parse(
- ' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '),
- recursivelyMatches({"x":3, "y": -4.5, "z" : "hi",
- "u" : true, "v": false }));
+ ' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '),
+ equals({"x":3, "y": -4.5, "z" : "hi", "u" : true, "v": false }));
expect(JSON.parse(' {"x":3, "y": -4.5, "z" : "hi" } '),
- recursivelyMatches({"x":3, "y": -4.5, "z" : "hi" }));
+ equals({"x":3, "y": -4.5, "z" : "hi" }));
expect(JSON.parse(' {"y": -4.5, "z" : "hi" ,"x":3 } '),
- recursivelyMatches({"y": -4.5, "z" : "hi" ,"x":3 }));
+ equals({"y": -4.5, "z" : "hi" ,"x":3 }));
expect(JSON.parse('{ " hi bob " :3, "": 4.5}'),
- recursivelyMatches({ " hi bob " :3, "": 4.5}));
+ equals({ " hi bob " :3, "": 4.5}));
- expect(JSON.parse(' { "x" : { } } '),
- recursivelyMatches({ 'x' : {}}));
- expect(JSON.parse('{"x":{}}'),
- recursivelyMatches({ 'x' : {}}));
+ expect(JSON.parse(' { "x" : { } } '), equals({ 'x' : {}}));
+ expect(JSON.parse('{"x":{}}'), equals({ 'x' : {}}));
// Nulls are tricky.
- expect(JSON.parse('{"w":null}'),
- recursivelyMatches({ 'w' : null}));
+ expect(JSON.parse('{"w":null}'), equals({ 'w' : null}));
- expect(JSON.parse('{"x":{"w":null}}'),
- recursivelyMatches({"x":{"w":null}}));
+ expect(JSON.parse('{"x":{"w":null}}'), equals({"x":{"w":null}}));
expect(JSON.parse(' {"x":3, "y": -4.5, "z" : "hi",'
'"w":null, "u" : true, "v": false } '),
- recursivelyMatches({"x":3, "y": -4.5, "z" : "hi",
+ equals({"x":3, "y": -4.5, "z" : "hi",
"w":null, "u" : true, "v": false }));
expect(JSON.parse('{"x": {"a":3, "b": -4.5}, "y":[{}], '
'"z":"hi","w":{"c":null,"d":true}, "v":null}'),
- recursivelyMatches({"x": {"a":3, "b": -4.5}, "y":[{}],
+ equals({"x": {"a":3, "b": -4.5}, "y":[{}],
"z":"hi","w":{"c":null,"d":true}, "v":null}));
test('stringify', () {
@@ -142,7 +136,7 @@
* back, and produce something equivalent to the argument.
*/
validateRoundTrip(expected) {
- expect(JSON.parse(JSON.stringify(expected)), recursivelyMatches(expected));
+ expect(JSON.parse(JSON.stringify(expected)), equals(expected));
}
« no previous file with comments | « lib/unittest/unittest.dart ('k') | tests/lib/unittest/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698