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 |
5 testRemove(Collection base) { | 7 testRemove(Collection base) { |
6 int length = base.length; | 8 int length = base.length; |
7 for (int i = 0; i < length; i++) { | 9 for (int i = 0; i < length; i++) { |
8 Expect.isFalse(base.isEmpty); | 10 Expect.isFalse(base.isEmpty); |
9 base.remove(base.first); | 11 base.remove(base.first); |
10 } | 12 } |
11 Expect.isTrue(base.isEmpty); | 13 Expect.isTrue(base.isEmpty); |
12 } | 14 } |
13 | 15 |
14 testRemoveAll(Collection base, Iterable removes) { | 16 testRemoveAll(Collection base, Iterable removes) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 testRemoveAll(base.toSet(), delta); | 103 testRemoveAll(base.toSet(), delta); |
102 testRemoveAll(base.toSet(), deltaSet); | 104 testRemoveAll(base.toSet(), deltaSet); |
103 testRetainAll(base.toSet(), delta); | 105 testRetainAll(base.toSet(), delta); |
104 testRetainAll(base.toSet(), deltaSet); | 106 testRetainAll(base.toSet(), deltaSet); |
105 testRemoveMatching(base.toSet(), deltaSet.contains); | 107 testRemoveMatching(base.toSet(), deltaSet.contains); |
106 testRetainMatching(base.toSet(), (e) => !deltaSet.contains(e)); | 108 testRetainMatching(base.toSet(), (e) => !deltaSet.contains(e)); |
107 } | 109 } |
108 } | 110 } |
109 } | 111 } |
110 | 112 |
OLD | NEW |