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

Side by Side Diff: test/union_set_controller_test.dart

Issue 1873373002: Add GroupSet and SetGroup classes. (Closed) Base URL: git@github.com:dart-lang/collection@master
Patch Set: Code review changes Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | test/union_set_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:test/test.dart";
6
7 import "package:collection/collection.dart";
8
9 void main() {
10 var controller;
11 var innerSet;
12 setUp(() {
13 innerSet = new Set.from([1, 2, 3]);
14 controller = new UnionSetController<int>()..add(innerSet);
15 });
16
17 test("exposes a union set", () {
18 expect(controller.set, unorderedEquals([1, 2, 3]));
19
20 controller.add(new Set.from([3, 4, 5]));
21 expect(controller.set, unorderedEquals([1, 2, 3, 4, 5]));
22
23 controller.remove(innerSet);
24 expect(controller.set, unorderedEquals([3, 4, 5]));
25 });
26
27 test("exposes a disjoint union set", () {
28 expect(controller.set, unorderedEquals([1, 2, 3]));
29
30 controller.add(new Set.from([4, 5, 6]));
31 expect(controller.set, unorderedEquals([1, 2, 3, 4, 5, 6]));
32
33 controller.remove(innerSet);
34 expect(controller.set, unorderedEquals([4, 5, 6]));
35 });
36 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/union_set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698