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

Unified Diff: tests/lib/async/stream_min_max_test.dart

Issue 14071002: Added new version of reduce. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed more uses of max, and a few bugs. Created 7 years, 8 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: tests/lib/async/stream_min_max_test.dart
diff --git a/tests/lib/async/stream_min_max_test.dart b/tests/lib/async/stream_min_max_test.dart
deleted file mode 100644
index ef6aa007c293cff1a601f0b050c8b87ce580e8ab..0000000000000000000000000000000000000000
--- a/tests/lib/async/stream_min_max_test.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library stream_min_max_test;
-
-import "package:expect/expect.dart";
-import 'dart:async';
-import 'dart:isolate';
-import '../../../pkg/unittest/lib/unittest.dart';
-import 'event_helper.dart';
-
-const int big = 1000000;
-const double inf = double.INFINITY;
-List intList = const [-0, 0, -1, 1, -10, 10, -big, big];
-List doubleList = const [-0.0, 0.0, -1.0, 1.0, -10.0, 10.0, -inf, inf];
-
-main() {
- testMinMax(name, iterable, min, max, [int compare(a, b)]) {
- test("$name-min", () {
- StreamController c = new StreamController();
- Future f = c.stream.min(compare);
- f.then(expectAsync1((v) { Expect.equals(min, v);}));
- new Events.fromIterable(iterable).replay(c);
- });
- test("$name-max", () {
- StreamController c = new StreamController();
- Future f = c.stream.max(compare);
- f.then(expectAsync1((v) { Expect.equals(max, v);}));
- new Events.fromIterable(iterable).replay(c);
- });
- }
-
- testMinMax("const-int", intList, -big, big);
- testMinMax("list-int", intList.toList(), -big, big);
- testMinMax("set-int", intList.toSet(), -big, big);
-
- testMinMax("const-double", doubleList, -inf, inf);
- testMinMax("list-double", doubleList.toList(), -inf, inf);
- testMinMax("set-double", doubleList.toSet(), -inf, inf);
-
- int reverse(a, b) => b.compareTo(a);
- testMinMax("rev-int", intList, big, -big, reverse);
- testMinMax("rev-double", doubleList, inf, -inf, reverse);
-}

Powered by Google App Engine
This is Rietveld 408576698