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

Unified Diff: tests/corelib_strong/splay_tree_from_iterable_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_strong/splay_tree_from_iterable_test.dart
diff --git a/tests/corelib_strong/splay_tree_from_iterable_test.dart b/tests/corelib_strong/splay_tree_from_iterable_test.dart
index 2212c10c0fed9f071d47c98d91245ea29ba5ff77..97a8732c30fc18d3ee99151712dff4f05517903f 100644
--- a/tests/corelib_strong/splay_tree_from_iterable_test.dart
+++ b/tests/corelib_strong/splay_tree_from_iterable_test.dart
@@ -109,7 +109,8 @@ void equalElementsTest() {
}
void genericTypeTest() {
- var map = new SplayTreeMap<int, String>.fromIterable([1, 2, 3], value: (x) => '$x');
+ var map =
+ new SplayTreeMap<int, String>.fromIterable([1, 2, 3], value: (x) => '$x');
Expect.isTrue(map is Map<int, String>);
Expect.isTrue(map is SplayTreeMap<int, String>);
@@ -117,6 +118,7 @@ void genericTypeTest() {
Expect.isFalse(map is SplayTreeMap<String, dynamic>);
Expect.isFalse(map is SplayTreeMap<dynamic, int>);
}
+
typedef String intToString(int v);
typedef bool intToBool(int v);
@@ -130,40 +132,35 @@ void typedTest() {
intToString key = (int v) => "$v";
intToBool value = (int v) => v.isOdd;
Function id = (int i) => i;
-
+
Expect.throws(() {
- new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
- key: key
- // No "value" map, defaults to identity, which returns int, not bool.
- );
+ new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3], key: key
+ // No "value" map, defaults to identity, which returns int, not bool.
+ );
});
Expect.throws(() {
- new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
- // No "key" map, defaults to identity, which returns int, not String.
- value: value
- );
+ new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3],
+ // No "key" map, defaults to identity, which returns int, not String.
+ value: value);
});
Expect.throws(() {
- new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
- key: id as dynamic, // wrong type.
- value: value
- );
+ new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3],
+ key: id as dynamic, // wrong type.
+ value: value);
});
Expect.throws(() {
- new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
- key: key,
- value: id as dynamic // wrong type.
- );
+ new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3],
+ key: key, value: id as dynamic // wrong type.
+ );
});
// But it works with explicit types when used correctly.
- SplayTreeMap<String, bool> map =
- new SplayTreeMap<String, bool>.fromIterable(<int>[1, 2, 3],
- key: key,
- value: value);
+ SplayTreeMap<String, bool> map = new SplayTreeMap<String, bool>.fromIterable(
+ <int>[1, 2, 3],
+ key: key, value: value);
Iterable<String> keys = map.keys;
Iterable<bool> values = map.values;
List<String> keyList = keys.toList();

Powered by Google App Engine
This is Rietveld 408576698