Index: pkg/unittest/lib/src/pretty_print.dart |
diff --git a/pkg/unittest/lib/src/pretty_print.dart b/pkg/unittest/lib/src/pretty_print.dart |
index 14a0bb1f44c1f03d9847ddc88fcb2caa7fb6da82..a748ec356a7028b0e24288285ea75d4079a66eb7 100644 |
--- a/pkg/unittest/lib/src/pretty_print.dart |
+++ b/pkg/unittest/lib/src/pretty_print.dart |
@@ -4,6 +4,7 @@ |
library unittest.pretty_print; |
+import '../matcher.dart'; |
Siggi Cherem (dart-lang)
2014/02/28 02:41:04
use package: ?
Bob Nystrom
2014/02/28 17:31:24
Do you think that's better? It seems a bit weird t
Siggi Cherem (dart-lang)
2014/02/28 17:37:19
Not really.
I think in general is a bad idea to u
|
import 'utils.dart'; |
/** |
@@ -19,6 +20,13 @@ import 'utils.dart'; |
*/ |
String prettyPrint(object, {int maxLineLength, int maxItems}) { |
String _prettyPrint(object, int indent, Set seen, bool top) { |
+ // If the object is a matcher, use its description. |
+ if (object is Matcher) { |
+ var description = new StringDescription(); |
+ object.describe(description); |
+ return "<$description>"; |
+ } |
+ |
// Avoid looping infinitely on recursively-nested data structures. |
if (seen.contains(object)) return "(recursive)"; |
seen = seen.union(new Set.from([object])); |