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

Unified Diff: client/testing/unittest/unittestsuite.dart

Issue 8341003: Get touch tests working at all, and with new API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Mark test as skipped instead of commenting out. Created 9 years, 2 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 | « no previous file | client/tests/client/client.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/testing/unittest/unittestsuite.dart
diff --git a/client/testing/unittest/unittestsuite.dart b/client/testing/unittest/unittestsuite.dart
index a12972e44561780ce0eae718b70c788fc383adb3..2006051cc42d0a9a53c31581651e92eeffa57940 100644
--- a/client/testing/unittest/unittestsuite.dart
+++ b/client/testing/unittest/unittestsuite.dart
@@ -358,13 +358,19 @@ class Expectation {
Expectation(this._value);
- // TODO(rnystrom): Get rid of this and use .equals(). After some discussion,
- // we decided this is the wrong approach for a bunch of reasons, clever as it
- // may be.
/** Asserts that the value is equivalent to the given expected value. */
- bool equals(expected) {
+ void equals(expected) {
Expect.equals(expected, _value);
- return _value == expected;
+ }
+
+ /**
+ * Failure if the difference between expected and actual is greater than the
+ * given tolerance. If no tolerance is given, tolerance is assumed to be the
+ * value 4 significant digits smaller than the value given for expected.
+ */
+ void approxEquals(num expected,
+ [num tolerance = null, String reason = null]) {
+ Expect.approxEquals(expected, _value, tolerance: tolerance, reason: reason);
}
/** Asserts that the value is null. */
« no previous file with comments | « no previous file | client/tests/client/client.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698