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

Unified Diff: tests/lib_2/math/min_max_test.dart

Issue 2995343002: Migrated test block 216 to Dart 2.0. (Closed)
Patch Set: Migrated min_max_test to Dart 2.0 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib_2/lib_2_vm.status ('k') | tests/lib_2/math/pi_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib_2/math/min_max_test.dart
diff --git a/tests/lib/math/min_max_test.dart b/tests/lib_2/math/min_max_test.dart
similarity index 96%
rename from tests/lib/math/min_max_test.dart
rename to tests/lib_2/math/min_max_test.dart
index 6cf4dfc32fe3db84b02c4c1a9caf8ea029e4961b..9977797453203ad4f5a9ff9cc6a52acabea64b2e 100644
--- a/tests/lib/math/min_max_test.dart
+++ b/tests/lib_2/math/min_max_test.dart
@@ -13,10 +13,10 @@ var inf = double.INFINITY;
var nan = double.NAN;
// A class that might work if [min] and [max] worked for non-numbers.
-class Wrap implements Comparable {
- final value;
+class Wrap implements Comparable<dynamic> {
+ final num value;
Wrap(this.value);
- int compareTo(Wrap other) => value.compareTo(other.value);
+ int compareTo(dynamic other) => value.compareTo(other.value);
bool operator <(Wrap other) => compareTo(other) < 0;
bool operator <=(Wrap other) => compareTo(other) <= 0;
bool operator >(Wrap other) => compareTo(other) > 0;
@@ -33,7 +33,6 @@ testMin() {
testMin1();
testMin2();
testMin3();
- testMinChecks();
}
testMin1() {
@@ -298,19 +297,10 @@ testMin3() {
Expect.isFalse(min(inf, inf).isNegative);
}
-testMinChecks() {
- // Min and max work only on numbers.
- // These throw a type assertion or ArgumentError.
- Expect.throws(() => min(wrap1, wrap2));
- Expect.throws(() => min(wrap1, 0));
- Expect.throws(() => min(0, wrap2));
-}
-
testMax() {
testMax1();
testMax2();
testMax3();
- testMaxChecks();
}
testMax1() {
@@ -565,14 +555,6 @@ testMax3() {
Expect.isTrue(max(-inf, -inf).isNegative);
}
-testMaxChecks() {
- // Min and max work only on numbers.
- // These throw a type assertion or ArgumentError.
- Expect.throws(() => min(wrap1, wrap2));
- Expect.throws(() => min(wrap1, 0));
- Expect.throws(() => min(0, wrap2));
-}
-
main() {
testMin();
testMin();
« no previous file with comments | « tests/lib_2/lib_2_vm.status ('k') | tests/lib_2/math/pi_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698