| Index: pkg/unittest/lib/src/numeric_matchers.dart
|
| ===================================================================
|
| --- pkg/unittest/lib/src/numeric_matchers.dart (revision 24041)
|
| +++ pkg/unittest/lib/src/numeric_matchers.dart (working copy)
|
| @@ -100,7 +100,7 @@
|
| [valueInDescription = true]) :
|
| this._valueInDescription = valueInDescription;
|
|
|
| - bool matches(item, MatchState matchState) {
|
| + bool matches(item, Map matchState) {
|
| if (item == _value) {
|
| return _equalValue;
|
| } else if (item < _value) {
|
| @@ -118,6 +118,12 @@
|
| return description.add(_comparisonDescription);
|
| }
|
| }
|
| +
|
| + Description describeMismatch(item, Description mismatchDescription,
|
| + Map matchState, bool verbose) {
|
| + mismatchDescription.add('is not ');
|
| + return describe(mismatchDescription);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -132,7 +138,7 @@
|
|
|
| const _IsCloseTo(this._value, this._delta);
|
|
|
| - bool matches(item, MatchState matchState) {
|
| + bool matches(item, Map matchState) {
|
| if (!_isNumeric(item)) {
|
| return false;
|
| }
|
| @@ -148,14 +154,14 @@
|
| addDescriptionOf(_value);
|
|
|
| Description describeMismatch(item, Description mismatchDescription,
|
| - MatchState matchState, bool verbose) {
|
| + Map matchState, bool verbose) {
|
| if (item is !num) {
|
| return mismatchDescription.add(' not numeric');
|
| } else {
|
| var diff = item - _value;
|
| if (diff < 0) diff = -diff;
|
| return mismatchDescription.
|
| - add(' differed by ').
|
| + add(' differs by ').
|
| addDescriptionOf(diff);
|
| }
|
| }
|
| @@ -192,7 +198,7 @@
|
| const _InRange(this._low, this._high,
|
| this._lowMatchValue, this._highMatchValue);
|
|
|
| - bool matches(value, MatchState matchState) {
|
| + bool matches(value, Map matchState) {
|
| if (value is !num) {
|
| return false;
|
| }
|
| @@ -214,7 +220,7 @@
|
| "$_high (${_highMatchValue ? 'inclusive' : 'exclusive'})");
|
|
|
| Description describeMismatch(item, Description mismatchDescription,
|
| - MatchState matchState, bool verbose) {
|
| + Map matchState, bool verbose) {
|
| if (item is !num) {
|
| return mismatchDescription.
|
| addDescriptionOf(item).
|
|
|