Index: pkg/unittest/expect.dart |
=================================================================== |
--- pkg/unittest/expect.dart (revision 14156) |
+++ pkg/unittest/expect.dart (working copy) |
@@ -2,14 +2,13 @@ |
// 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; |
+ |
/** |
* 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 +32,8 @@ |
* [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, FailureHandler failureHandler, |
+ bool verbose : false}) { |
matcher = wrapMatcher(matcher); |
bool doesMatch; |
var matchState = new MatchState(); |