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

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

Issue 16408019: Improved error messages from unittest. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: pkg/unittest/lib/src/expect.dart
===================================================================
--- pkg/unittest/lib/src/expect.dart (revision 23884)
+++ pkg/unittest/lib/src/expect.dart (working copy)
@@ -141,10 +141,12 @@
var mismatchDescription = new StringDescription();
matcher.describeMismatch(actual, mismatchDescription, matchState, verbose);
- description.add(' But: ')
- .add(mismatchDescription.toString()).add('.\n');
- description.add('Actual: ').addDescriptionOf(actual);
+ description.add(' Actual: ').addDescriptionOf(actual);
+ var info = mismatchDescription.toString();
+ if (info.length > 0) {
Siggi Cherem (dart-lang) 2013/06/12 00:34:45 how about use mismatchDescription.length here?
gram 2013/06/13 19:06:15 Done.
+ description.add(' Which: ${info}\n');
Siggi Cherem (dart-lang) 2013/06/12 00:34:45 then this can simply be $mispatchDescription
Siggi Cherem (dart-lang) 2013/06/12 00:34:45 " Which:" => " Reason:" ?
gram 2013/06/13 19:06:15 Done.
gram 2013/06/13 19:06:15 "Which" scans better IMO.
+ }
if (reason != null) {
description.add(reason).add('\n');
}

Powered by Google App Engine
This is Rietveld 408576698