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

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

Issue 638433003: Adding a reason field to expectAsync and expectAsyncUntil (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/unittest/lib/src/spread_args_helper.dart ('k') | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 05eca70f9fcc558fda37b68ee17d2ea35d2c2d3b..21e648efc096651087074dbb171fab5b34892934 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -297,9 +297,13 @@ void solo_test(String spec, TestFunction body) {
/// the upper bound to the same value as [count]; i.e. the callback should be
/// called exactly [count] times. A value of -1 for [max] will mean no upper
/// bound.
+///
+/// [reason] is optional and is typically not supplied, as a reason is generated
+/// by the unittest package; if reason is included it is appended to the
+/// generated reason.
Function expectAsync(Function callback,
- {int count: 1, int max: 0, String id}) =>
- new _SpreadArgsHelper(callback, count, max, id).func;
+ {int count: 1, int max: 0, String id, String reason}) =>
+ new _SpreadArgsHelper(callback, count, max, id, reason).func;
/// Indicate that [callback] is expected to be called until [isDone] returns
/// true. The unittest framework check [isDone] after each callback and only
@@ -309,8 +313,13 @@ Function expectAsync(Function callback,
/// arguments (named arguments are not supported). [id] can be used to
/// identify the callback in error messages (for example if it is called
/// after the test case is complete).
-Function expectAsyncUntil(Function callback, bool isDone(), {String id}) =>
- new _SpreadArgsHelper(callback, 0, -1, id, isDone: isDone).func;
+///
+/// [reason] is optional and is typically not supplied, as a reason is generated
+/// by the unittest package; if reason is included it is appended to the
+/// generated reason.
+Function expectAsyncUntil(Function callback, bool isDone(),
+ {String id, String reason}) =>
+ new _SpreadArgsHelper(callback, 0, -1, id, reason, isDone: isDone).func;
/// Creates a new named group of tests. Calls to group() or test() within the
/// body of the function passed to this will inherit this group's description.
« no previous file with comments | « pkg/unittest/lib/src/spread_args_helper.dart ('k') | pkg/unittest/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698