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

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

Issue 16408019: Improved error messages from unittest. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/iterable_matchers.dart
===================================================================
--- pkg/unittest/lib/src/iterable_matchers.dart (revision 23884)
+++ pkg/unittest/lib/src/iterable_matchers.dart (working copy)
@@ -42,7 +42,7 @@
if (matchState.state != null) {
var index = matchState.state['index'];
var element = matchState.state['element'];
- mismatchDescription.add('position $index ');
+ mismatchDescription.add('at position $index ');
return _matcher.describeMismatch(element, mismatchDescription,
matchState.state['state'], verbose);
}
@@ -95,7 +95,7 @@
Description describeMismatch(item, Description mismatchDescription,
MatchState matchState, bool verbose) {
if (item is !Iterable) {
- return mismatchDescription.add('not an Iterable');
+ return mismatchDescription.add('is not an Iterable');
} else {
return _matcher.describeMismatch(item, mismatchDescription,
matchState, verbose);
@@ -230,14 +230,15 @@
Description describeMismatch(item, Description mismatchDescription,
MatchState matchState, bool verbose) {
if (item is !Iterable) {
- return mismatchDescription.add('not an Iterable');
+ return mismatchDescription.add('is not an Iterable');
} else if (item.length != _expected.length) {
return mismatchDescription.
- add('length was ${item.length} instead of ${_expected.length}');
+ add('has length ${item.length} instead of ${_expected.length}');
} else {
return mismatchDescription.
+ add('has ').
addDescriptionOf(matchState.state["actual"]).
- add(' not $_description ').
+ add(' which is not $_description ').
addDescriptionOf(matchState.state["expected"]).
add(' at position ${matchState.state["index"]}');
}

Powered by Google App Engine
This is Rietveld 408576698