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

Unified Diff: packages/collection/test/union_set_controller_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/collection/test/typed_wrapper/set_test.dart ('k') | packages/collection/test/union_set_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/collection/test/union_set_controller_test.dart
diff --git a/packages/collection/test/union_set_controller_test.dart b/packages/collection/test/union_set_controller_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..aa8c1c9f51ae50bebb98070245be4eef2a8abf34
--- /dev/null
+++ b/packages/collection/test/union_set_controller_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:test/test.dart";
+
+import "package:collection/collection.dart";
+
+void main() {
+ var controller;
+ var innerSet;
+ setUp(() {
+ innerSet = new Set.from([1, 2, 3]);
+ controller = new UnionSetController<int>()..add(innerSet);
+ });
+
+ test("exposes a union set", () {
+ expect(controller.set, unorderedEquals([1, 2, 3]));
+
+ controller.add(new Set.from([3, 4, 5]));
+ expect(controller.set, unorderedEquals([1, 2, 3, 4, 5]));
+
+ controller.remove(innerSet);
+ expect(controller.set, unorderedEquals([3, 4, 5]));
+ });
+
+ test("exposes a disjoint union set", () {
+ expect(controller.set, unorderedEquals([1, 2, 3]));
+
+ controller.add(new Set.from([4, 5, 6]));
+ expect(controller.set, unorderedEquals([1, 2, 3, 4, 5, 6]));
+
+ controller.remove(innerSet);
+ expect(controller.set, unorderedEquals([4, 5, 6]));
+ });
+}
« no previous file with comments | « packages/collection/test/typed_wrapper/set_test.dart ('k') | packages/collection/test/union_set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698