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

Unified Diff: tests/corelib/set_test.dart

Issue 2413233002: Change Set.difference API to accept Set<Object>. (Closed)
Patch Set: Also update a few subclasses. Created 4 years, 2 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
« no previous file with comments | « sdk/lib/core/set.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/set_test.dart
diff --git a/tests/corelib/set_test.dart b/tests/corelib/set_test.dart
index 55e7250aa99b76acc296a0933df0459fd8d2fe88..9900bb809d63ea4f7ac34a80fd39afae3b27f2f3 100644
--- a/tests/corelib/set_test.dart
+++ b/tests/corelib/set_test.dart
@@ -166,6 +166,17 @@ void testInts(Set create()) {
}
Expect.isTrue(twice.difference(thrice).difference(twice).isEmpty);
+ // Test Set.difference with non-element type.
+ Set diffSet = create()..addAll([0, 1, 2, 499, 999]);
+ Set<Object> objectSet = new Set<Object>();
+ objectSet.add("foo");
+ objectSet.add(499);
+ Set diffResult = diffSet.difference(objectSet);
+ Expect.equals(4, diffResult.length);
+ for (int value in [0, 1, 2, 999]) {
+ Expect.isTrue(diffResult.contains(value));
+ }
+
// Test Set.addAll.
List list = new List(10);
for (int i = 0; i < 10; i++) {
« no previous file with comments | « sdk/lib/core/set.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698