| 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:unittest/unittest.dart"; | 9 import "package:test/test.dart"; |
| 10 | 10 |
| 11 // Test that any member access/call on the wrapper object is equal to | 11 // Test that any member access/call on the wrapper object is equal to |
| 12 // an expected access on the wrapped object. | 12 // an expected access on the wrapped object. |
| 13 // This is implemented by capturing accesses using noSuchMethod and comparing | 13 // This is implemented by capturing accesses using noSuchMethod and comparing |
| 14 // them to expected accesses captured previously. | 14 // them to expected accesses captured previously. |
| 15 | 15 |
| 16 // Compare two Invocations for having equal type and arguments. | 16 // Compare two Invocations for having equal type and arguments. |
| 17 void testInvocations(Invocation i1, Invocation i2) { | 17 void testInvocations(Invocation i1, Invocation i2) { |
| 18 String name = "${i1.memberName}"; | 18 String name = "${i1.memberName}"; |
| 19 expect(i1.isGetter, equals(i2.isGetter), reason: name); | 19 expect(i1.isGetter, equals(i2.isGetter), reason: name); |
| (...skipping 635 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 |