Chromium Code Reviews| 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'); |
| } |