Index: pkg/unittest/lib/expect.dart |
=================================================================== |
--- pkg/unittest/lib/expect.dart (revision 0) |
+++ pkg/unittest/lib/expect.dart (working copy) |
@@ -2,9 +2,23 @@ |
// 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 [asyncGuard] property is a function that |
Siggi Cherem (dart-lang)
2012/10/31 20:54:02
asyncGuard => _wrapAsync?
gram
2012/11/01 21:23:19
Done.
|
+ * 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. |
+ */ |
Siggi Cherem (dart-lang)
2012/10/31 20:54:02
nits:
- move this comment to the publicly visible
gram
2012/11/01 21:23:19
Done.
|
+ |
+Function _wrapAsync = (f) => f; |
+ |
+set wrapAsync(Function f) => _wrapAsync = f; |
Siggi Cherem (dart-lang)
2012/10/31 20:54:02
seems silly to have a private property that can be
gram
2012/11/01 21:23:19
Done.
|
+ |
+/** |
* 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] |