Add pretty-printing to unittest and more thoroughly print values.
This adds a prettyPrint function that knows to respect line lengths and avoid printing too much of very large objects. Because that function has built-in guards against over-printing, the default error formatter is changed to print the actual value by default. This also tweaks the output of some matchers to take advantage of the assumption that the full actual value will always be printed. R=gram@google.com Review URL: https://codereview.chromium.org//14600029 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/unittest@22873 260f80e4-7a28-3924-810f-c04153c831b5
Showing
- lib/matcher.dart 3 additions, 0 deletionslib/matcher.dart
- lib/src/core_matchers.dart 2 additions, 26 deletionslib/src/core_matchers.dart
- lib/src/description.dart 2 additions, 33 deletionslib/src/description.dart
- lib/src/expect.dart 9 additions, 22 deletionslib/src/expect.dart
- lib/src/iterable_matchers.dart 2 additions, 1 deletionlib/src/iterable_matchers.dart
- lib/src/map_matchers.dart 2 additions, 2 deletionslib/src/map_matchers.dart
- lib/src/numeric_matchers.dart 1 addition, 4 deletionslib/src/numeric_matchers.dart
- lib/src/operator_matchers.dart 3 additions, 3 deletionslib/src/operator_matchers.dart
- lib/src/pretty_print.dart 102 additions, 0 deletionslib/src/pretty_print.dart
- lib/src/utils.dart 48 additions, 0 deletionslib/src/utils.dart
- test/instance_test.dart 5 additions, 3 deletionstest/instance_test.dart
- test/matchers_test.dart 165 additions, 124 deletionstest/matchers_test.dart
- test/pretty_print_test.dart 221 additions, 0 deletionstest/pretty_print_test.dart
- test/unittest_test.dart 4 additions, 4 deletionstest/unittest_test.dart
Loading
Please register or sign in to comment