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

Unified Diff: lib/mirror_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 | « codereview.settings ('k') | lib/src/core_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/mirror_matchers.dart
diff --git a/lib/mirror_matchers.dart b/lib/mirror_matchers.dart
index f397128fc2b74c3cfc97e39c75a7082800ec51cb..d24483199e2d3ab4fb5e8523e5eb7c8308c8f18d 100644
--- a/lib/mirror_matchers.dart
+++ b/lib/mirror_matchers.dart
@@ -14,7 +14,7 @@ import 'matcher.dart';
/// with name [name], and optionally, if that property in turn satisfies
/// a [matcher].
Matcher hasProperty(String name, [matcher]) =>
- new _HasProperty(name, matcher == null ? null : wrapMatcher(matcher));
+ new _HasProperty(name, matcher == null ? null : wrapMatcher(matcher));
class _HasProperty extends Matcher {
final String _name;
@@ -35,8 +35,10 @@ class _HasProperty extends Matcher {
bool isInstanceGetter =
candidate is MethodMirror && candidate.isGetter && !candidate.isStatic;
if (!(isInstanceField || isInstanceGetter)) {
- addStateInfo(matchState, {'reason':
- 'has a member named "$_name", but it is not an instance property'});
+ addStateInfo(matchState, {
+ 'reason':
+ 'has a member named "$_name", but it is not an instance property'
+ });
return false;
}
if (_matcher == null) return true;
@@ -56,17 +58,18 @@ class _HasProperty extends Matcher {
return description;
}
- Description describeMismatch(item, Description mismatchDescription,
- Map matchState, bool verbose) {
+ Description describeMismatch(
+ item, Description mismatchDescription, Map matchState, bool verbose) {
var reason = matchState == null ? null : matchState['reason'];
if (reason != null) {
mismatchDescription.add(reason);
} else {
- mismatchDescription.add('has property "$_name" with value ').
- addDescriptionOf(matchState['value']);
+ mismatchDescription
+ .add('has property "$_name" with value ')
+ .addDescriptionOf(matchState['value']);
var innerDescription = new StringDescription();
- _matcher.describeMismatch(matchState['value'], innerDescription,
- matchState['state'], verbose);
+ _matcher.describeMismatch(
+ matchState['value'], innerDescription, matchState['state'], verbose);
if (innerDescription.length > 0) {
mismatchDescription.add(' which ').add(innerDescription.toString());
}
« no previous file with comments | « codereview.settings ('k') | lib/src/core_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698