| Index: tests/lib_strong/collection/linked_list_test.dart
|
| diff --git a/tests/lib_strong/collection/linked_list_test.dart b/tests/lib_strong/collection/linked_list_test.dart
|
| index 3ed06b75cde1057dd0243aedaea8a5bb1bbd9adc..10f7c7725cb245a75b2c51ce97dac703bdb9f128 100644
|
| --- a/tests/lib_strong/collection/linked_list_test.dart
|
| +++ b/tests/lib_strong/collection/linked_list_test.dart
|
| @@ -13,7 +13,6 @@ class MyEntry extends LinkedListEntry<MyEntry> {
|
| String toString() => value.toString();
|
| }
|
|
|
| -
|
| testInsert() {
|
| // Insert last.
|
| var list = new LinkedList<MyEntry>();
|
| @@ -83,7 +82,6 @@ testInsert() {
|
| list.clear();
|
| }
|
|
|
| -
|
| testRemove() {
|
| var list = new LinkedList<MyEntry>();
|
| for (int i = 0; i < 10; i++) {
|
| @@ -103,8 +101,8 @@ testRemove() {
|
| i++;
|
| }
|
|
|
| - Expect.listEquals([0, 1, 2, 3, 4, 6, 7, 8, 9],
|
| - list.map((e) => e.value).toList());
|
| + Expect.listEquals(
|
| + [0, 1, 2, 3, 4, 6, 7, 8, 9], list.map((e) => e.value).toList());
|
|
|
| for (int i = 0; i < 9; i++) {
|
| list.first.unlink();
|
| @@ -115,7 +113,6 @@ testRemove() {
|
| Expect.equals(0, list.length);
|
| }
|
|
|
| -
|
| testBadAdd() {
|
| var list1 = new LinkedList<MyEntry>();
|
| list1.addFirst(new MyEntry(0));
|
| @@ -127,7 +124,6 @@ testBadAdd() {
|
| }
|
|
|
| testConcurrentModificationError() {
|
| -
|
| test(function(LinkedList ll)) {
|
| var ll = new LinkedList<MyEntry>();
|
| for (int i = 0; i < 10; i++) {
|
| @@ -135,19 +131,71 @@ testConcurrentModificationError() {
|
| }
|
| Expect.throws(() => function(ll), (e) => e is ConcurrentModificationError);
|
| }
|
| - test((ll) { for(var x in ll) { ll.remove(x); } });
|
| - test((ll) { ll.forEach((x) { ll.remove(x); }); });
|
| - test((ll) { ll.any((x) { ll.remove(x); return false; }); });
|
| - test((ll) { ll.every((x) { ll.remove(x); return true; }); });
|
| - test((ll) { ll.fold(0, (x, y) { ll.remove(y); return x; }); });
|
| - test((ll) { ll.reduce((x, y) { ll.remove(y); return x; }); });
|
| - test((ll) { ll.where((x) { ll.remove(x); return true; }).forEach((_) {}); });
|
| - test((ll) { ll.map((x) { ll.remove(x); return x; }).forEach((_) {}); });
|
| - test((ll) { ll.expand((x) { ll.remove(x); return[x];}).forEach((_) {}); });
|
| - test((ll) { ll.takeWhile((x) {
|
| - ll.remove(x); return true;}).forEach((_) {}); });
|
| - test((ll) { ll.skipWhile((x) {
|
| - ll.remove(x); return true;}).forEach((_) {}); });
|
| +
|
| + test((ll) {
|
| + for (var x in ll) {
|
| + ll.remove(x);
|
| + }
|
| + });
|
| + test((ll) {
|
| + ll.forEach((x) {
|
| + ll.remove(x);
|
| + });
|
| + });
|
| + test((ll) {
|
| + ll.any((x) {
|
| + ll.remove(x);
|
| + return false;
|
| + });
|
| + });
|
| + test((ll) {
|
| + ll.every((x) {
|
| + ll.remove(x);
|
| + return true;
|
| + });
|
| + });
|
| + test((ll) {
|
| + ll.fold(0, (x, y) {
|
| + ll.remove(y);
|
| + return x;
|
| + });
|
| + });
|
| + test((ll) {
|
| + ll.reduce((x, y) {
|
| + ll.remove(y);
|
| + return x;
|
| + });
|
| + });
|
| + test((ll) {
|
| + ll.where((x) {
|
| + ll.remove(x);
|
| + return true;
|
| + }).forEach((_) {});
|
| + });
|
| + test((ll) {
|
| + ll.map((x) {
|
| + ll.remove(x);
|
| + return x;
|
| + }).forEach((_) {});
|
| + });
|
| + test((ll) {
|
| + ll.expand((x) {
|
| + ll.remove(x);
|
| + return [x];
|
| + }).forEach((_) {});
|
| + });
|
| + test((ll) {
|
| + ll.takeWhile((x) {
|
| + ll.remove(x);
|
| + return true;
|
| + }).forEach((_) {});
|
| + });
|
| + test((ll) {
|
| + ll.skipWhile((x) {
|
| + ll.remove(x);
|
| + return true;
|
| + }).forEach((_) {});
|
| + });
|
| test((ll) {
|
| bool first = true;
|
| ll.firstWhere((x) {
|
| @@ -156,7 +204,12 @@ testConcurrentModificationError() {
|
| return first = false;
|
| });
|
| });
|
| - test((ll) { ll.lastWhere((x) { ll.remove(x); return true;}); });
|
| + test((ll) {
|
| + ll.lastWhere((x) {
|
| + ll.remove(x);
|
| + return true;
|
| + });
|
| + });
|
| test((ll) {
|
| bool first = true;
|
| ll.singleWhere((x) {
|
|
|