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

Unified Diff: lib/core/expect.dart

Issue 10913271: Move parseInt parseDouble to int/double classes as a static method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make int.parse directly native. Created 8 years, 3 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 | « lib/core/double.dart ('k') | lib/core/int.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/expect.dart
diff --git a/lib/core/expect.dart b/lib/core/expect.dart
index 5d27b4b2401215fcda002da73fe5d181cd2d2b93..d9346bcbca1aa62fb09e57cb7d4993178ec59159 100644
--- a/lib/core/expect.dart
+++ b/lib/core/expect.dart
@@ -82,7 +82,7 @@ class Expect {
[num tolerance = null,
String reason = null]) {
if (tolerance === null) {
- tolerance = (expected / pow(10.0, 4.0)).abs();
+ tolerance = (expected / 1e4).abs();
}
// Note: use !( <= ) rather than > so we fail on NaNs
if ((expected - actual).abs() <= tolerance) return;
@@ -107,7 +107,7 @@ class Expect {
*/
static void listEquals(List expected, List actual, [String reason = null]) {
String msg = _getMessage(reason);
- int n = min(expected.length, actual.length);
+ int n = (expected.length < actual.length) ? expected.length : actual.length;
for (int i = 0; i < n; i++) {
if (expected[i] != actual[i]) {
_fail('Expect.listEquals(at index $i, '
« no previous file with comments | « lib/core/double.dart ('k') | lib/core/int.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698