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

Side by Side Diff: packages/collection/test/equality_map_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
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:collection/collection.dart';
6 import 'package:test/test.dart';
7
8 void main() {
9 test("uses the given equality", () {
10 var map = new EqualityMap(const IterableEquality());
11 expect(map, isEmpty);
12
13 map[[1, 2, 3]] = 1;
14 expect(map, containsPair([1, 2, 3], 1));
15
16 map[[1, 2, 3]] = 2;
17 expect(map, containsPair([1, 2, 3], 2));
18
19 map[[2, 3, 4]] = 3;
20 expect(map, containsPair([1, 2, 3], 2));
21 expect(map, containsPair([2, 3, 4], 3));
22 });
23
24 test("EqualityMap.from() prefers the lattermost equivalent key", () {
25 var map = new EqualityMap.from(const IterableEquality(), {
26 [1, 2, 3]: 1,
27 [2, 3, 4]: 2,
28 [1, 2, 3]: 3,
29 [2, 3, 4]: 4,
30 [1, 2, 3]: 5,
31 [1, 2, 3]: 6,
32 });
33
34 expect(map, containsPair([1, 2, 3], 6));
35 expect(map, containsPair([2, 3, 4], 4));
36 });
37 }
OLDNEW
« no previous file with comments | « packages/collection/test/comparators_test.dart ('k') | packages/collection/test/equality_set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698