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

Side by Side Diff: packages/quiver/test/collection/collection_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
1 // Copyright 2013 Google Inc. All Rights Reserved. 1 // Copyright 2013 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 }); 62 });
63 63
64 test('return false for non-equal sets', () { 64 test('return false for non-equal sets', () {
65 expect(setsEqual(null, new Set()), isFalse); 65 expect(setsEqual(null, new Set()), isFalse);
66 expect(setsEqual(new Set(), null), isFalse); 66 expect(setsEqual(new Set(), null), isFalse);
67 expect(setsEqual(new Set.from([1]), new Set.from([2])), isFalse); 67 expect(setsEqual(new Set.from([1]), new Set.from([2])), isFalse);
68 expect(setsEqual(new Set.from([1]), new Set()), isFalse); 68 expect(setsEqual(new Set.from([1]), new Set()), isFalse);
69 expect(setsEqual(new Set(), new Set.from([1])), isFalse); 69 expect(setsEqual(new Set(), new Set.from([1])), isFalse);
70 }); 70 });
71 }); 71 });
72
73 group('indexOf', () {
74 test('returns the first matching index', () {
75 expect(indexOf<int>([1, 12, 19, 20, 24], (n) => n % 2 == 0), 1);
76 expect(indexOf<String>(['a', 'b', 'a'], (s) => s == 'a'), 0);
77 });
78
79 test('returns -1 when there is no match', () {
80 expect(indexOf<int>([1, 3, 7], (n) => n % 2 == 0), -1);
81 expect(indexOf<String>(['a', 'b'], (s) => s == 'e'), -1);
82 expect(indexOf<bool>([], (_) => true), -1);
83 });
84 });
72 } 85 }
OLDNEW
« no previous file with comments | « packages/quiver/test/collection/bimap_test.dart ('k') | packages/quiver/test/collection/delegates/set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698