Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: tests/corelib/set_test.dart

Issue 23859008: Convert HashSet, LinkedHashSet to factory methods and custom implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/corelib/set_test.dart
diff --git a/tests/corelib/set_test.dart b/tests/corelib/set_test.dart
index f08583554288900e82cf9ffcfa4f0a2c947554ca..5b9763c7756c8aa255f9730eb1eb6083ebd3c79d 100644
--- a/tests/corelib/set_test.dart
+++ b/tests/corelib/set_test.dart
@@ -10,6 +10,7 @@ import "dart:collection";
void testMain(Set create()) {
Set set = create();
+
testLength(0, set);
set.add(1);
testLength(1, set);
@@ -189,6 +190,15 @@ void testLength(int length, Set set) {
}
main() {
- testMain(() => new Set());
testMain(() => new HashSet());
+ testMain(() => new LinkedHashSet());
+ testMain(() => new HashSet(equals: identical));
+ testMain(() => new LinkedHashSet(equals: identical));
+ testMain(() => new HashSet(equals: (int a, int b) => a == b || a == -b,
+ hashCode: (int n) => n.hashCode & (-n).hashCode,
+ isValidKey: (n) => n is int));
+ testMain(() => new LinkedHashSet(
+ equals: (int a, int b) => a == b || a == -b,
+ hashCode: (int n) => n.hashCode & (-n).hashCode,
+ isValidKey: (n) => n is int));
}

Powered by Google App Engine
This is Rietveld 408576698