Index: tests/corelib/splay_tree_test.dart |
diff --git a/tests/corelib/splay_tree_test.dart b/tests/corelib/splay_tree_test.dart |
index c6de49736b6fbb9b14bc581de80f801ad4a8f24c..f1064a3b8679bf6b9f719b5a4a17e92d72fbfdc6 100644 |
--- a/tests/corelib/splay_tree_test.dart |
+++ b/tests/corelib/splay_tree_test.dart |
@@ -4,10 +4,10 @@ |
// Dart test for Splaytrees. |
library splay_tree_test; |
+ |
import "package:expect/expect.dart"; |
import 'dart:collection'; |
- |
main() { |
// Simple tests. |
SplayTreeMap tree = new SplayTreeMap(); |
@@ -27,7 +27,8 @@ main() { |
for (var v in ["first", "second", "third", "fourth", "fifth"]) { |
Expect.isTrue(tree.containsValue(v)); |
- }; |
+ } |
+ ; |
Expect.isFalse(tree.containsValue("sixth")); |
tree[7] = "seventh"; |
@@ -75,10 +76,10 @@ void regressRemoveWhere2() { |
var t = new SplayTreeSet(); |
t.addAll([1, 2, 3, 4, 5]); |
- t.removeWhere((_) => true); // Should not throw. |
+ t.removeWhere((_) => true); // Should not throw. |
Expect.isTrue(t.isEmpty); |
t.addAll([1, 2, 3, 4, 5]); |
- t.retainWhere((_) => false); // Should not throw. |
+ t.retainWhere((_) => false); // Should not throw. |
Expect.isTrue(t.isEmpty); |
} |
@@ -95,8 +96,6 @@ void testSetFrom() { |
Expect.equals(3, set2.length); |
} |
- |
- |
void regressFromCompare() { |
// Regression test for http://dartbug.com/23387. |
// The compare and isValidKey arguments to SplayTreeMap.from were ignored. |
@@ -107,13 +106,14 @@ void regressFromCompare() { |
} |
throw "isValidKey failure"; |
} |
+ |
bool isValidKey(o) => o is IncomparableKey; |
IncomparableKey key(int n) => new IncomparableKey(n); |
var entries = {key(0): 0, key(1): 1, key(2): 2, key(0): 0}; |
Expect.equals(4, entries.length); |
- var map = new SplayTreeMap<IncomparableKey, int>.from( |
- entries, compare, isValidKey); |
+ var map = |
+ new SplayTreeMap<IncomparableKey, int>.from(entries, compare, isValidKey); |
Expect.equals(3, map.length); |
for (int i = 0; i < 3; i++) { |
Expect.isTrue(map.containsKey(key(i))); |
@@ -125,8 +125,12 @@ void regressFromCompare() { |
Expect.equals(null, map[key(5)]); |
Expect.equals(null, map[1]); |
Expect.equals(null, map["string"]); |
- Expect.throws(() { map[1] = 42; }); |
- Expect.throws(() { map["string"] = 42; }); |
+ Expect.throws(() { |
+ map[1] = 42; |
+ }); |
+ Expect.throws(() { |
+ map["string"] = 42; |
+ }); |
map[key(5)] = 42; |
Expect.equals(4, map.length); |
Expect.equals(42, map[key(5)]); |