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

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

Issue 19653008: FIx a typo in SIMMIPS min/max and enable min_max_test for SIMMIPS by splitting the main functions i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/math/min_max_test.dart
===================================================================
--- tests/lib/math/min_max_test.dart (revision 25308)
+++ tests/lib/math/min_max_test.dart (working copy)
@@ -9,6 +9,11 @@
import 'dart:math';
testMin() {
+ testMin1();
+ testMin2();
+}
+
+testMin1() {
Expect.equals(0, min(0, 2));
Expect.equals(0, min(2, 0));
@@ -28,7 +33,6 @@
Expect.equals(-10.5, min(-9.5, -10.5));
Expect.equals(-10.5, min(9.5, -10.5));
Expect.equals(-10.5, min(0.5, -10.5));
-
// Test matrix:
// NaN, -infinity, -499.0, -499, -0.0, 0.0, 0, 499.0, 499, +infinity.
var inf = double.INFINITY;
@@ -172,7 +176,11 @@
Expect.isTrue(min(0, 499.0) is int);
Expect.isTrue(min(0, 499) is int);
Expect.isTrue(min(0, inf) is int);
+}
+testMin2() {
+ var inf = double.INFINITY;
+ var nan = double.NAN;
Expect.isTrue(min(0, -499.0).isNegative);
Expect.isTrue(min(0, -499).isNegative);
Expect.isTrue(min(0, -0.0).isNegative);
@@ -271,6 +279,11 @@
}
testMax() {
+ testMax1();
+ testMax2();
+}
+
+testMax1() {
Expect.equals(2, max(0, 2));
Expect.equals(2, max(2, 0));
@@ -430,7 +443,12 @@
Expect.isTrue(max(-0.0, -499) is double);
Expect.isTrue(max(-0.0, -499.0) is double);
Expect.isTrue(max(-0.0, -inf) is double);
+}
+testMax2() {
+ var inf = double.INFINITY;
+ var nan = double.NAN;
+
Expect.isFalse(max(-0.0, 0.0).isNegative);
Expect.isFalse(max(-0.0, 0).isNegative);
Expect.isTrue(max(-0.0, -0.0).isNegative);
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698