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

Unified Diff: lib/src/expect.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/error_matchers.dart ('k') | lib/src/future_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/expect.dart
diff --git a/lib/src/expect.dart b/lib/src/expect.dart
index 1bfa36ef37298b92516e800c7e273dea1efa8de8..08eb68eb9a31e9659ede0c3e0e9700f15644dfce 100644
--- a/lib/src/expect.dart
+++ b/lib/src/expect.dart
@@ -32,8 +32,8 @@ abstract class FailureHandler {
/// some cases how much [matchState] information is used. It will use
/// these to create a detailed error message (typically by calling
/// an [ErrorFormatter]) and then call [fail] with this message.
- void failMatch(actual, Matcher matcher, String reason,
- Map matchState, bool verbose);
+ void failMatch(
+ actual, Matcher matcher, String reason, Map matchState, bool verbose);
}
/// The ErrorFormatter type is used for functions that
@@ -42,8 +42,8 @@ abstract class FailureHandler {
/// which is used by the default failure handler. If the failure handler
/// is replaced it may be desirable to replace the [stringDescription]
/// error formatter with another.
-typedef String ErrorFormatter(actual, Matcher matcher, String reason,
- Map matchState, bool verbose);
+typedef String ErrorFormatter(
+ actual, Matcher matcher, String reason, Map matchState, bool verbose);
/// This Function is used by certain Matchers to catch certain exceptions.
///
@@ -75,8 +75,8 @@ Function wrapAsync = (Function f, [id]) => f;
/// In some cases extra diagnostic info can be produced on failure (for
/// example, stack traces on mismatched exceptions). To enable these,
/// [verbose] should be specified as true;
-void expect(actual, matcher, {String reason, FailureHandler failureHandler,
- bool verbose : false}) {
+void expect(actual, matcher,
+ {String reason, FailureHandler failureHandler, bool verbose: false}) {
matcher = wrapMatcher(matcher);
bool doesMatch;
var matchState = {};
@@ -116,8 +116,8 @@ class DefaultFailureHandler implements FailureHandler {
void fail(String reason) {
throw new TestFailure(reason);
}
- void failMatch(actual, Matcher matcher, String reason,
- Map matchState, bool verbose) {
+ void failMatch(
+ actual, Matcher matcher, String reason, Map matchState, bool verbose) {
fail(_assertErrorFormatter(actual, matcher, reason, matchState, verbose));
}
}
@@ -145,8 +145,8 @@ FailureHandler getOrCreateExpectFailureHandler() {
ErrorFormatter _assertErrorFormatter = null;
// The default error formatter implementation.
-String _defaultErrorFormatter(actual, Matcher matcher, String reason,
- Map matchState, bool verbose) {
+String _defaultErrorFormatter(
+ actual, Matcher matcher, String reason, Map matchState, bool verbose) {
var description = new StringDescription();
description.add('Expected: ').addDescriptionOf(matcher).add('\n');
description.add(' Actual: ').addDescriptionOf(actual).add('\n');
« no previous file with comments | « lib/src/error_matchers.dart ('k') | lib/src/future_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698