| Index: pkg/unittest/lib/src/string_matchers.dart
|
| ===================================================================
|
| --- pkg/unittest/lib/src/string_matchers.dart (revision 24002)
|
| +++ pkg/unittest/lib/src/string_matchers.dart (working copy)
|
| @@ -18,7 +18,7 @@
|
| _matchValue = _value.toLowerCase();
|
| }
|
|
|
| - bool matches(item, MatchState mismatchState) =>
|
| + bool matches(item, Map matchState) =>
|
| item is String && _matchValue == item.toLowerCase();
|
|
|
| Description describe(Description description) =>
|
| @@ -44,17 +44,18 @@
|
| _matchValue = collapseWhitespace(_value);
|
| }
|
|
|
| - bool matches(item, MatchState matchState) =>
|
| + bool matches(item, Map matchState) =>
|
| item is String && _matchValue == collapseWhitespace(item);
|
|
|
| Description describe(Description description) =>
|
| description.addDescriptionOf(_matchValue).add(' ignoring whitespace');
|
|
|
| Description describeMismatch(item, Description mismatchDescription,
|
| - MatchState matchState, bool verbose) {
|
| + Map matchState, bool verbose) {
|
| if (item is String) {
|
| - return mismatchDescription.add('was ').
|
| - addDescriptionOf(collapseWhitespace(item));
|
| + return mismatchDescription.add('is ').
|
| + addDescriptionOf(collapseWhitespace(item)).
|
| + add(' with whitespace compressed');
|
| } else {
|
| return super.describeMismatch(item, mismatchDescription,
|
| matchState, verbose);
|
| @@ -96,7 +97,7 @@
|
|
|
| const _StringStartsWith(this._prefix);
|
|
|
| - bool matches(item, MatchState matchState) =>
|
| + bool matches(item, Map matchState) =>
|
| item is String && item.startsWith(_prefix);
|
|
|
| Description describe(Description description) =>
|
| @@ -115,7 +116,7 @@
|
|
|
| const _StringEndsWith(this._suffix);
|
|
|
| - bool matches(item, MatchState matchState) =>
|
| + bool matches(item, Map matchState) =>
|
| item is String && item.endsWith(_suffix);
|
|
|
| Description describe(Description description) =>
|
| @@ -139,7 +140,7 @@
|
|
|
| const _StringContainsInOrder(this._substrings);
|
|
|
| - bool matches(item, MatchState matchState) {
|
| + bool matches(item, Map matchState) {
|
| if (!(item is String)) {
|
| return false;
|
| }
|
| @@ -178,7 +179,7 @@
|
| }
|
| }
|
|
|
| - bool matches(item, MatchState matchState) =>
|
| + bool matches(item, Map matchState) =>
|
| item is String ? _regexp.hasMatch(item) : false;
|
|
|
| Description describe(Description description) =>
|
| @@ -190,7 +191,7 @@
|
| abstract class _StringMatcher extends BaseMatcher {
|
| const _StringMatcher();
|
| Description describeMismatch(item, Description mismatchDescription,
|
| - MatchState matchState, bool verbose) {
|
| + Map matchState, bool verbose) {
|
| if (!(item is String)) {
|
| return mismatchDescription.
|
| addDescriptionOf(item).
|
|
|