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

Unified Diff: lib/unittest/numeric_matchers.dart

Issue 10832058: Improved the way we generate mismatch descriptions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « lib/unittest/mock.dart ('k') | lib/unittest/operator_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/numeric_matchers.dart
===================================================================
--- lib/unittest/numeric_matchers.dart (revision 10002)
+++ lib/unittest/numeric_matchers.dart (working copy)
@@ -95,10 +95,10 @@
this._lessThanValue,
this._greaterThanValue,
this._comparisonDescription,
- [valueInDescription = true]) :
+ [valueInDescription = true]) :
this._valueInDescription = valueInDescription;
- bool matches(item) {
+ bool matches(item, MatchState matchState) {
if (item == _value) {
return _equalValue;
} else if (item < _value) {
@@ -130,7 +130,7 @@
const _IsCloseTo(this._value, this._delta);
- bool matches(item) {
+ bool matches(item, MatchState matchState) {
if (!_isNumeric(item)) {
return false;
}
@@ -145,7 +145,8 @@
add(' of ').
addDescriptionOf(_value);
- Description describeMismatch(item, Description mismatchDescription) {
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
if (item is !num) {
return mismatchDescription.
addDescriptionOf(item).
@@ -192,7 +193,7 @@
const _InRange(this._low, this._high,
this._lowMatchValue, this._highMatchValue);
- bool matches(value) {
+ bool matches(value, MatchState matchState) {
if (value is !num) {
return false;
}
@@ -213,13 +214,15 @@
"$_low (${_lowMatchValue ? 'inclusive' : 'exclusive'}) to "
"$_high (${_highMatchValue ? 'inclusive' : 'exclusive'})");
- Description describeMismatch(item, Description mismatchDescription) {
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
if (item is !num) {
return mismatchDescription.
addDescriptionOf(item).
add(' not numeric');
} else {
- return super.describeMismatch(item, mismatchDescription);
+ return super.describeMismatch(item, mismatchDescription,
+ matchState, verbose);
}
}
}
« no previous file with comments | « lib/unittest/mock.dart ('k') | lib/unittest/operator_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698