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

Unified Diff: pkg/matcher/lib/src/expect.dart

Issue 629113002: Adjusting matcher comments with one-line summaries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging master Created 6 years, 2 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 | « pkg/matcher/lib/src/core_matchers.dart ('k') | pkg/matcher/lib/src/future_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/matcher/lib/src/expect.dart
diff --git a/pkg/matcher/lib/src/expect.dart b/pkg/matcher/lib/src/expect.dart
index bd54747685403042ad7830864c949482ce78c9fc..1bfa36ef37298b92516e800c7e273dea1efa8de8 100644
--- a/pkg/matcher/lib/src/expect.dart
+++ b/pkg/matcher/lib/src/expect.dart
@@ -45,6 +45,8 @@ abstract class FailureHandler {
typedef String ErrorFormatter(actual, Matcher matcher, String reason,
Map matchState, bool verbose);
+/// This Function is used by certain Matchers to catch certain exceptions.
+///
/// Some matchers, like those for Futures and exception testing,
/// can fail in asynchronous sections, and throw exceptions.
/// A user of this library will typically want to catch and handle
@@ -54,9 +56,10 @@ typedef String ErrorFormatter(actual, Matcher matcher, String reason,
/// to be `expectAsync`. By default this is an identity function.
Function wrapAsync = (Function f, [id]) => f;
-/// This is the main assertion function. It asserts that [actual]
-/// matches the [matcher]. [reason] is optional and is typically not
-/// supplied, as a reason is generated from the matcher; if [reason]
+/// Assert that [actual] matches [matcher].
+///
+/// This is the main assertion function. [reason] is optional and is typically
+/// not supplied, as a reason is generated from the matcher; if [reason]
/// is included it is appended to the reason generated by the matcher.
///
/// [matcher] can be a value in which case it will be wrapped in an
@@ -119,7 +122,8 @@ class DefaultFailureHandler implements FailureHandler {
}
}
-/// Changes or resets to the default the failure handler for expect()
+/// Changes the default failure handler for [expect].
+///
/// [handler] is a reference to the new handler; if this is omitted
/// or null then the failure handler is reset to the default, which
/// throws [TestFailure]s on [expect] assertion failures.
@@ -159,7 +163,8 @@ String _defaultErrorFormatter(actual, Matcher matcher, String reason,
return description.toString();
}
-/// Changes or resets to default the failure message formatter for expect().
+/// Changes the failure message formatter for expect().
+///
/// [formatter] is a reference to the new formatter; if this is omitted or
/// null then the failure formatter is reset to the default. The new
/// formatter is returned; this allows custom expect handlers to easily
« no previous file with comments | « pkg/matcher/lib/src/core_matchers.dart ('k') | pkg/matcher/lib/src/future_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698