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

Unified Diff: pkg/unittest/lib/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, 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
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]

Powered by Google App Engine
This is Rietveld 408576698