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

Unified Diff: packages/quiver/test/streams/collect_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/quiver/test/streams/all_tests.dart ('k') | packages/quiver/test/streams/concat_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/quiver/test/streams/collect_test.dart
diff --git a/packages/quiver/test/streams/collect_test.dart b/packages/quiver/test/streams/collect_test.dart
deleted file mode 100644
index a806fd86fe2624dcc0a86ffac93a035166555039..0000000000000000000000000000000000000000
--- a/packages/quiver/test/streams/collect_test.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-library quiver.streams.collect_test;
-
-import 'dart:async';
-import 'dart:math';
-
-import 'package:test/test.dart';
-import 'package:quiver/streams.dart';
-
-main() {
- group('collect', () {
- test('should produce no events for no futures',
- () => collect([]).toList().then((events) => expect(events, isEmpty)));
-
- test('should produce events for future completions in input order', () {
- var futures = new Iterable.generate(
- 5, (int i) => i.isEven ? new Future.value(i) : new Future.error(i));
- var events = [];
- var done = new Completer();
-
- collect(futures).listen(events.add, onError: (i) {
- events.add('e$i');
- }, onDone: done.complete);
- return Future.wait(futures).catchError((_) => done.future).then((_) {
- expect(events, [0, 'e1', 2, 'e3', 4]);
- });
- });
-
- test('should only advance iterator once '
- 'event for previous future is sent', () {
- var eventCount = 0;
- var maxParallel = 0;
- var currentParallel = 0;
- var done = new Completer();
- var futures = new Iterable.generate(3, (_) {
- maxParallel = max(++currentParallel, maxParallel);
- return new Future.value();
- });
-
- var collected = collect(futures);
-
- decrementParallel(_) {
- eventCount++;
- currentParallel--;
- }
-
- collected.listen(decrementParallel,
- onError: decrementParallel, onDone: done.complete);
- return done.future.then((_) {
- expect(maxParallel, 1);
- expect(eventCount, 3);
- });
- });
- });
-}
« no previous file with comments | « packages/quiver/test/streams/all_tests.dart ('k') | packages/quiver/test/streams/concat_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698