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

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

Issue 11301046: Restructure pkg/unittest and pkg/webdriver to follow the pub conventions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/unittest/lib/src/description.dart ('k') | pkg/unittest/lib/src/future_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/expect.dart
===================================================================
--- pkg/unittest/lib/src/expect.dart (revision 0)
+++ pkg/unittest/lib/src/expect.dart (working copy)
@@ -2,9 +2,20 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of unittest;
+part of matcher;
/**
+ * 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
+ * such exceptions. The [wrapAsync] property is a function that
+ * can wrap callbacks used by these Matchers so that they can be
+ * used safely. For example, the unittest library will set this
+ * to be expectAsync1. By default this is an identity function.
+ */
+Function wrapAsync = (f) => 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]
@@ -23,14 +34,6 @@
* 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;
- *
- * expect() is a 3rd generation assertion mechanism, drawing
- * inspiration from [Hamcrest] and Ladislav Thon's [dart-matchers]
- * library.
- *
- * See [Hamcrest] http://en.wikipedia.org/wiki/Hamcrest
- * [Hamcrest] http://code.google.com/p/hamcrest/
- * [dart-matchers] https://github.com/Ladicek/dart-matchers
*/
void expect(actual, matcher, {String reason, FailureHandler failureHandler,
bool verbose : false}) {
« no previous file with comments | « pkg/unittest/lib/src/description.dart ('k') | pkg/unittest/lib/src/future_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698