| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Tests wrapper utilities. | 5 /// Tests wrapper utilities. |
| 6 | 6 |
| 7 import "dart:collection"; | 7 import "dart:collection"; |
| 8 import "package:collection/collection.dart"; | 8 import "package:collection/collection.dart"; |
| 9 import "package:test/test.dart"; | 9 import "package:test/test.dart"; |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void main() { | 140 void main() { |
| 141 testIterable(var expect) { | 141 testIterable(var expect) { |
| 142 expect.any(func1).equals.any(func1); | 142 expect.any(func1).equals.any(func1); |
| 143 expect.contains(val).equals.contains(val); | 143 expect.contains(val).equals.contains(val); |
| 144 expect.elementAt(0).equals.elementAt(0); | 144 expect.elementAt(0).equals.elementAt(0); |
| 145 expect.every(func1).equals.every(func1); | 145 expect.every(func1).equals.every(func1); |
| 146 expect.expand(func1).equals.expand(func1); | 146 expect.expand(func1).equals.expand(func1); |
| 147 expect.first.equals.first; | 147 expect.first.equals.first; |
| 148 // Default values of the Iterable interface will be added in the | 148 // Default values of the Iterable interface will be added in the |
| 149 // second call to firstWhere, so we must record them in our | 149 // second call to firstWhere, so we must record them in our |
| 150 // expectation (which doesn't have the interface implementat or | 150 // expectation (which doesn't have the interface implemented or |
| 151 // its default values). | 151 // its default values). |
| 152 expect.firstWhere(func1, orElse: null).equals.firstWhere(func1); | 152 expect.firstWhere(func1, orElse: null).equals.firstWhere(func1); |
| 153 expect.firstWhere(func1, orElse: func0).equals. | 153 expect.firstWhere(func1, orElse: func0).equals. |
| 154 firstWhere(func1, orElse: func0); | 154 firstWhere(func1, orElse: func0); |
| 155 expect.fold(null, func2).equals.fold(null, func2); | 155 expect.fold(null, func2).equals.fold(null, func2); |
| 156 expect.forEach(func1).equals.forEach(func1); | 156 expect.forEach(func1).equals.forEach(func1); |
| 157 expect.isEmpty.equals.isEmpty; | 157 expect.isEmpty.equals.isEmpty; |
| 158 expect.isNotEmpty.equals.isNotEmpty; | 158 expect.isNotEmpty.equals.isNotEmpty; |
| 159 expect.iterator.equals.iterator; | 159 expect.iterator.equals.iterator; |
| 160 expect.join('').equals.join(); | 160 expect.join('').equals.join(); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 | 655 |
| 656 test(".retainWhere", () { | 656 test(".retainWhere", () { |
| 657 map["f"] = "foo"; | 657 map["f"] = "foo"; |
| 658 map["b"] = "bar"; | 658 map["b"] = "bar"; |
| 659 map["q"] = "qoo"; | 659 map["q"] = "qoo"; |
| 660 set.retainWhere((element) => element.endsWith("o")); | 660 set.retainWhere((element) => element.endsWith("o")); |
| 661 expect(map, equals({"f": "foo", "q": "qoo"})); | 661 expect(map, equals({"f": "foo", "q": "qoo"})); |
| 662 }); | 662 }); |
| 663 }); | 663 }); |
| 664 } | 664 } |
| OLD | NEW |