OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | |
6 | |
7 testRemove(Collection base) { | 5 testRemove(Collection base) { |
8 int length = base.length; | 6 int length = base.length; |
9 for (int i = 0; i < length; i++) { | 7 for (int i = 0; i < length; i++) { |
10 Expect.isFalse(base.isEmpty); | 8 Expect.isFalse(base.isEmpty); |
11 base.remove(base.first); | 9 base.remove(base.first); |
12 } | 10 } |
13 Expect.isTrue(base.isEmpty); | 11 Expect.isTrue(base.isEmpty); |
14 } | 12 } |
15 | 13 |
16 testRemoveAll(Collection base, Iterable removes) { | 14 testRemoveAll(Collection base, Iterable removes) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 testRemoveAll(base.toSet(), delta); | 101 testRemoveAll(base.toSet(), delta); |
104 testRemoveAll(base.toSet(), deltaSet); | 102 testRemoveAll(base.toSet(), deltaSet); |
105 testRetainAll(base.toSet(), delta); | 103 testRetainAll(base.toSet(), delta); |
106 testRetainAll(base.toSet(), deltaSet); | 104 testRetainAll(base.toSet(), deltaSet); |
107 testRemoveMatching(base.toSet(), deltaSet.contains); | 105 testRemoveMatching(base.toSet(), deltaSet.contains); |
108 testRetainMatching(base.toSet(), (e) => !deltaSet.contains(e)); | 106 testRetainMatching(base.toSet(), (e) => !deltaSet.contains(e)); |
109 } | 107 } |
110 } | 108 } |
111 } | 109 } |
112 | 110 |
OLD | NEW |