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

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 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();

Powered by Google App Engine
This is Rietveld 408576698