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

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

Issue 14600029: Add pretty-printing to unittest and more thoroughly print values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 7 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/numeric_matchers.dart
diff --git a/pkg/unittest/lib/src/numeric_matchers.dart b/pkg/unittest/lib/src/numeric_matchers.dart
index e5dd7ef9d57cae5e586b6bfab39a8812f987c6f7..84afb49c2fd70b5071b2c8206242b06070e38762 100644
--- a/pkg/unittest/lib/src/numeric_matchers.dart
+++ b/pkg/unittest/lib/src/numeric_matchers.dart
@@ -150,14 +150,11 @@ class _IsCloseTo extends BaseMatcher {
Description describeMismatch(item, Description mismatchDescription,
MatchState matchState, bool verbose) {
if (item is !num) {
- return mismatchDescription.
- addDescriptionOf(item).
- add(' not numeric');
+ return mismatchDescription.add(' not numeric');
} else {
var diff = item - _value;
if (diff < 0) diff = -diff;
return mismatchDescription.
- addDescriptionOf(item).
add(' differed by ').
addDescriptionOf(diff);
}

Powered by Google App Engine
This is Rietveld 408576698