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

Unified Diff: lib/src/string_matchers.dart

Issue 840133003: matcher: fixed status file, formatting, tweaks to readme (Closed) Base URL: https://github.com/dart-lang/matcher.git@master
Patch Set: nits Created 5 years, 11 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/src/prints_matcher.dart ('k') | lib/src/throws_matcher.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/string_matchers.dart
diff --git a/lib/src/string_matchers.dart b/lib/src/string_matchers.dart
index 616a4b633c58f9248fdeee5596b06b66c09693ce..c93963f4b7f07040c34a9742c9bf296b5803abfd 100644
--- a/lib/src/string_matchers.dart
+++ b/lib/src/string_matchers.dart
@@ -57,17 +57,18 @@ class _IsEqualIgnoringWhitespace extends _StringMatcher {
item is String && _matchValue == collapseWhitespace(item);
Description describe(Description description) =>
- description.addDescriptionOf(_matchValue).add(' ignoring whitespace');
+ description.addDescriptionOf(_matchValue).add(' ignoring whitespace');
- Description describeMismatch(item, Description mismatchDescription,
- Map matchState, bool verbose) {
+ Description describeMismatch(
+ item, Description mismatchDescription, Map matchState, bool verbose) {
if (item is String) {
- return mismatchDescription.add('is ').
- addDescriptionOf(collapseWhitespace(item)).
- add(' with whitespace compressed');
+ return mismatchDescription
+ .add('is ')
+ .addDescriptionOf(collapseWhitespace(item))
+ .add(' with whitespace compressed');
} else {
- return super.describeMismatch(item, mismatchDescription,
- matchState, verbose);
+ return super.describeMismatch(
+ item, mismatchDescription, matchState, verbose);
}
}
}
@@ -130,9 +131,8 @@ class _StringContainsInOrder extends _StringMatcher {
return true;
}
- Description describe(Description description) =>
- description.addAll('a string containing ', ', ', ' in order',
- _substrings);
+ Description describe(Description description) => description.addAll(
+ 'a string containing ', ', ', ' in order', _substrings);
}
/// Returns a matcher that matches if the match argument is a string and
@@ -156,7 +156,7 @@ class _MatchesRegExp extends _StringMatcher {
}
bool matches(item, Map matchState) =>
- item is String ? _regexp.hasMatch(item) : false;
+ item is String ? _regexp.hasMatch(item) : false;
Description describe(Description description) =>
description.add("match '${_regexp.pattern}'");
@@ -166,15 +166,13 @@ class _MatchesRegExp extends _StringMatcher {
// class to give better mismatch error messages than the base Matcher class.
abstract class _StringMatcher extends Matcher {
const _StringMatcher();
- Description describeMismatch(item, Description mismatchDescription,
- Map matchState, bool verbose) {
+ Description describeMismatch(
+ item, Description mismatchDescription, Map matchState, bool verbose) {
if (!(item is String)) {
- return mismatchDescription.
- addDescriptionOf(item).
- add(' not a string');
+ return mismatchDescription.addDescriptionOf(item).add(' not a string');
} else {
- return super.describeMismatch(item, mismatchDescription,
- matchState, verbose);
+ return super.describeMismatch(
+ item, mismatchDescription, matchState, verbose);
}
}
}
« no previous file with comments | « lib/src/prints_matcher.dart ('k') | lib/src/throws_matcher.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698