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

Unified Diff: tests/corelib/json_map_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/corelib/json_map_test.dart
diff --git a/tests/corelib/json_map_test.dart b/tests/corelib/json_map_test.dart
index e34e9744a4d40115efe048f7c72511a7863fe0f0..e4d46eecbed67e7c04de73ea1bdbeb6794e1d3d1 100644
--- a/tests/corelib/json_map_test.dart
+++ b/tests/corelib/json_map_test.dart
@@ -116,8 +116,10 @@ void testLookupNonExistingValues(Map map) {
}
void testOrder(List list) {
- if (list.isEmpty) return;
- else testOrder(list.skip(1).toList());
+ if (list.isEmpty)
+ return;
+ else
+ testOrder(list.skip(1).toList());
Map original = {};
for (int i = 0; i < list.length; i++) {
@@ -186,118 +188,114 @@ void testConcurrentModifications() {
}
Map map = {};
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map['a'] = 0)));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map['a'] = 0)));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map['a'] = 0)));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.clear())));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.clear())));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.clear())));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.remove('a'))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.remove('a'))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.remove('a'))));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.addAll({}))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.addAll({}))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.addAll({}))));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.addAll({'a': 0}))));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.addAll({'a': 0}))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.addAll({'a': 0}))));
+ Expect.isTrue(throwsCME(() => testKeys(jsonify(map), (map) => map['a'] = 0)));
+ Expect
+ .isTrue(throwsCME(() => testValues(jsonify(map), (map) => map['a'] = 0)));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map['a'] = 0)));
+
+ Expect.isFalse(throwsCME(() => testKeys(jsonify(map), (map) => map.clear())));
+ Expect
+ .isFalse(throwsCME(() => testValues(jsonify(map), (map) => map.clear())));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.clear())));
+
+ Expect.isFalse(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.remove('a'))));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map.remove('a'))));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.remove('a'))));
+
+ Expect.isTrue(throwsCME(
+ () => testKeys(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+ Expect.isTrue(throwsCME(
+ () => testValues(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+ Expect.isFalse(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+
+ Expect.isFalse(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.addAll({}))));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map.addAll({}))));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.addAll({}))));
+
+ Expect.isTrue(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.addAll({'a': 0}))));
+ Expect.isTrue(
+ throwsCME(() => testValues(jsonify(map), (map) => map.addAll({'a': 0}))));
+ Expect.isFalse(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.addAll({'a': 0}))));
map = {'a': 1};
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map['a'] = 0)));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map['a'] = 0)));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map['a'] = 0)));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map['b'] = 0)));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map['b'] = 0)));
- Expect.isTrue(throwsCME(() => testForEach(jsonify(map),
- (map) => map['b'] = 0)));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.clear())));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.clear())));
- Expect.isTrue(throwsCME(() => testForEach(jsonify(map),
- (map) => map.clear())));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.remove('a'))));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.remove('a'))));
- Expect.isTrue(throwsCME(() => testForEach(jsonify(map),
- (map) => map.remove('a'))));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.remove('b'))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.remove('b'))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.remove('b'))));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.putIfAbsent('a', () => 0))));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.putIfAbsent('b', () => 0))));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.putIfAbsent('b', () => 0))));
- Expect.isTrue(throwsCME(() => testForEach(jsonify(map),
- (map) => map.putIfAbsent('b', () => 0))));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.addAll({}))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.addAll({}))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.addAll({}))));
-
- Expect.isFalse(throwsCME(() => testKeys(jsonify(map),
- (map) => map.addAll({'a': 0}))));
- Expect.isFalse(throwsCME(() => testValues(jsonify(map),
- (map) => map.addAll({'a': 0}))));
- Expect.isFalse(throwsCME(() => testForEach(jsonify(map),
- (map) => map.addAll({'a': 0}))));
-
- Expect.isTrue(throwsCME(() => testKeys(jsonify(map),
- (map) => map.addAll({'b': 0}))));
- Expect.isTrue(throwsCME(() => testValues(jsonify(map),
- (map) => map.addAll({'b': 0}))));
- Expect.isTrue(throwsCME(() => testForEach(jsonify(map),
- (map) => map.addAll({'b': 0}))));
+ Expect
+ .isFalse(throwsCME(() => testKeys(jsonify(map), (map) => map['a'] = 0)));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map['a'] = 0)));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map['a'] = 0)));
+
+ Expect.isTrue(throwsCME(() => testKeys(jsonify(map), (map) => map['b'] = 0)));
+ Expect
+ .isTrue(throwsCME(() => testValues(jsonify(map), (map) => map['b'] = 0)));
+ Expect.isTrue(
+ throwsCME(() => testForEach(jsonify(map), (map) => map['b'] = 0)));
+
+ Expect.isTrue(throwsCME(() => testKeys(jsonify(map), (map) => map.clear())));
+ Expect
+ .isTrue(throwsCME(() => testValues(jsonify(map), (map) => map.clear())));
+ Expect
+ .isTrue(throwsCME(() => testForEach(jsonify(map), (map) => map.clear())));
+
+ Expect.isTrue(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.remove('a'))));
+ Expect.isTrue(
+ throwsCME(() => testValues(jsonify(map), (map) => map.remove('a'))));
+ Expect.isTrue(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.remove('a'))));
+
+ Expect.isFalse(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.remove('b'))));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map.remove('b'))));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.remove('b'))));
+
+ Expect.isFalse(throwsCME(
+ () => testKeys(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+ Expect.isFalse(throwsCME(
+ () => testValues(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+ Expect.isFalse(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.putIfAbsent('a', () => 0))));
+
+ Expect.isTrue(throwsCME(
+ () => testKeys(jsonify(map), (map) => map.putIfAbsent('b', () => 0))));
+ Expect.isTrue(throwsCME(
+ () => testValues(jsonify(map), (map) => map.putIfAbsent('b', () => 0))));
+ Expect.isTrue(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.putIfAbsent('b', () => 0))));
+
+ Expect.isFalse(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.addAll({}))));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map.addAll({}))));
+ Expect.isFalse(
+ throwsCME(() => testForEach(jsonify(map), (map) => map.addAll({}))));
+
+ Expect.isFalse(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.addAll({'a': 0}))));
+ Expect.isFalse(
+ throwsCME(() => testValues(jsonify(map), (map) => map.addAll({'a': 0}))));
+ Expect.isFalse(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.addAll({'a': 0}))));
+
+ Expect.isTrue(
+ throwsCME(() => testKeys(jsonify(map), (map) => map.addAll({'b': 0}))));
+ Expect.isTrue(
+ throwsCME(() => testValues(jsonify(map), (map) => map.addAll({'b': 0}))));
+ Expect.isTrue(throwsCME(
+ () => testForEach(jsonify(map), (map) => map.addAll({'b': 0}))));
}
void testType() {
@@ -328,7 +326,13 @@ void testClear() {
}
void testListEntry() {
- Map map = jsonify({'a': [7, 8, {'b': 9}]});
+ Map map = jsonify({
+ 'a': [
+ 7,
+ 8,
+ {'b': 9}
+ ]
+ });
List list = map['a'];
Expect.equals(3, list.length);
Expect.equals(7, list[0]);

Powered by Google App Engine
This is Rietveld 408576698