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

Unified Diff: lib/unittest/core_matchers.dart

Issue 10544167: Some unit test fixes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | lib/unittest/expect.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/core_matchers.dart
===================================================================
--- lib/unittest/core_matchers.dart (revision 8732)
+++ lib/unittest/core_matchers.dart (working copy)
@@ -147,8 +147,7 @@
* * A [Function] that throws an exception when called. The function cannot
* take any arguments. If you want to test that a function expecting
* arguments throws, wrap it in another zero-argument function that calls
- * the one you want to test. The function will be called once upon success,
- * or twice upon failure (the second time to get the failure description).
+ * the one you want to test.
*
* * A [Future] that completes with an exception. Note that this creates an
* asynchronous expectation. The call to `expect()` that includes this will
@@ -210,11 +209,11 @@
}
Description describeMismatch(item, Description mismatchDescription) {
- try {
- item();
+ if (_matcher == null) {
return mismatchDescription.add(' no exception');
- } catch (final e) {
- return mismatchDescription.add(' exception does not match ').
+ } else {
+ return mismatchDescription.
+ add(' no exception or exception does not match ').
addDescriptionOf(_matcher);
}
}
@@ -439,3 +438,4 @@
Description describe(Description description) =>
description.add('contains ').addDescriptionOf(_expected);
}
+
« no previous file with comments | « no previous file | lib/unittest/expect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698