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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
Index: tests/lib/convert/json_toEncodable_reviver_test.dart
diff --git a/tests/lib/convert/json_toEncodable_reviver_test.dart b/tests/lib/convert/json_toEncodable_reviver_test.dart
index 77ff1d4ac53ff2e3c98ce76b660461cfebabd7ad..5ef66ecbf32b873ff292ce4ca8d3ceea9874a613 100644
--- a/tests/lib/convert/json_toEncodable_reviver_test.dart
+++ b/tests/lib/convert/json_toEncodable_reviver_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
library json_tests;
+
import 'package:expect/expect.dart';
import 'dart:convert';
@@ -11,7 +12,7 @@ class A {
A(this.x);
}
-toEncodable(A a) => { "A": a.x };
+toEncodable(A a) => {"A": a.x};
reviver(key, value) {
if (value is Map && value.length == 1 && value["A"] != null) {
return new A(value["A"]);
@@ -23,7 +24,10 @@ const extendedJson =
const JsonCodec(toEncodable: toEncodable, reviver: reviver);
main() {
- var encoded = extendedJson.encode([new A(0), { "2": new A(1) }]);
+ var encoded = extendedJson.encode([
+ new A(0),
+ {"2": new A(1)}
+ ]);
Expect.equals('[{"A":0},{"2":{"A":1}}]', encoded);
var decoded = extendedJson.decode(encoded);
Expect.isTrue(decoded is List);
@@ -42,9 +46,8 @@ main() {
testInvalidMap();
}
-
void testInvalidMap() {
- var map = {"a" : 42, "b": 42, 37: 42}; // Non-string key.
+ var map = {"a": 42, "b": 42, 37: 42}; // Non-string key.
var enc = new JsonEncoder((_) => "fixed");
var res = enc.convert(map);
Expect.equals('"fixed"', res);

Powered by Google App Engine
This is Rietveld 408576698