Chromium Code Reviews| Index: pkg/unittest/lib/src/expect.dart |
| =================================================================== |
| --- pkg/unittest/lib/src/expect.dart (revision 18358) |
| +++ pkg/unittest/lib/src/expect.dart (working copy) |
| @@ -122,8 +122,24 @@ |
| add('\n but: '); |
| matcher.describeMismatch(actual, description, matchState, verbose); |
| description.add('.\n'); |
| - if (verbose && actual is Iterable) { |
| - description.add('Actual: ').addDescriptionOf(actual).add('\n'); |
| + if (verbose) { |
| + if (actual is Iterable) { |
| + description.add('Actual: ').addDescriptionOf(actual).add('\n'); |
| + } else if (actual is Map) { |
| + description.add('Actual: '); |
| + var count = 25; |
|
Siggi Cherem (dart-lang)
2013/02/12 21:06:15
seems quite arbitrary to use 25 =)... maybe 10? (e
gram
2013/02/12 21:08:09
As you say, it is arbitrary. 10 feels too small fo
|
| + for (var k in actual.keys) { |
|
Siggi Cherem (dart-lang)
2013/02/12 21:06:15
Is this description used for any other purpose? Wi
gram
2013/02/12 21:08:09
No. Unlike the matcher description; this is the er
|
| + if (count == 0) { |
| + description.add('...\n'); |
| + break; |
| + } |
| + description.addDescriptionOf(k); |
| + description.add(' : '); |
| + description.addDescriptionOf(actual[k]); |
| + description.add('\n'); |
| + --count; |
| + } |
| + } |
| } |
| if (reason != null) { |
| description.add(reason).add('\n'); |