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

Unified 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, 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
Index: packages/quiver/test/collection/collection_test.dart
diff --git a/packages/quiver/test/collection/collection_test.dart b/packages/quiver/test/collection/collection_test.dart
index c5fc143a31918009bd5cc9d0a6d7b9a734c602a6..80b84127e0ae4bddbc321b1512d0f68de3f487c4 100644
--- a/packages/quiver/test/collection/collection_test.dart
+++ b/packages/quiver/test/collection/collection_test.dart
@@ -69,4 +69,17 @@ main() {
expect(setsEqual(new Set(), new Set.from([1])), isFalse);
});
});
+
+ group('indexOf', () {
+ test('returns the first matching index', () {
+ expect(indexOf<int>([1, 12, 19, 20, 24], (n) => n % 2 == 0), 1);
+ expect(indexOf<String>(['a', 'b', 'a'], (s) => s == 'a'), 0);
+ });
+
+ test('returns -1 when there is no match', () {
+ expect(indexOf<int>([1, 3, 7], (n) => n % 2 == 0), -1);
+ expect(indexOf<String>(['a', 'b'], (s) => s == 'e'), -1);
+ expect(indexOf<bool>([], (_) => true), -1);
+ });
+ });
}
« 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