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

Unified Diff: pkg/unittest/expect.dart

Issue 11275054: Modified unittest to use new argument syntax. (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/expect.dart
===================================================================
--- pkg/unittest/expect.dart (revision 14114)
+++ pkg/unittest/expect.dart (working copy)
@@ -4,12 +4,9 @@
/**
* This is the main assertion function. It asserts that [actual]
- * matches the [matcher]. [matcher] is optional and defaults to isTrue,
- * so expect can be used with a single predicate argument. [reason]
- * is optional and is typically not supplied if a reasonable matcher is
- * explicitly provided, as a reason can be generated from the matcher.
- * If [reason] is included it is appended to the reason generated
- * by the matcher.
+ * matches the [matcher]. [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
* [equals] matcher.
@@ -33,9 +30,9 @@
* [Hamcrest] http://code.google.com/p/hamcrest/
* [dart-matchers] https://github.com/Ladicek/dart-matchers
*/
-void expect(actual, [matcher = isTrue, String reason = null,
- FailureHandler failureHandler = null,
- bool verbose = false]) {
+void expect(actual, matcher, { String reason : null,
Siggi Cherem (dart-lang) 2012/10/26 00:44:51 nits: - remove space between { and String - remove
Jennifer Messerly 2012/10/26 02:57:05 also, remove "null" if you can. AFAIK, it's implie
gram 2012/10/26 22:26:27 Done.
gram 2012/10/26 22:26:27 Done.
+ FailureHandler failureHandler : null,
+ bool verbose : false}) {
matcher = wrapMatcher(matcher);
bool doesMatch;
var matchState = new MatchState();

Powered by Google App Engine
This is Rietveld 408576698