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

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

Issue 15344002: Fix an analyzer error in unittest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f73dd211fd188f054e2bf99a9527a6780f6311c..1608e108defc222ba69fb7ee3f080b1ee6259689 100644
--- a/pkg/unittest/lib/src/pretty_print.dart
+++ b/pkg/unittest/lib/src/pretty_print.dart
@@ -26,7 +26,7 @@ String prettyPrint(object, {int maxLineLength, int maxItems}) {
if (object is Iterable) {
// Print the type name for non-List iterables.
- var typeName = object is List ? "" : typeName(object) + ":";
+ var type = object is List ? "" : typeName(object) + ":";
// Truncate the list of strings if it's longer than [maxItems].
var strings = object.map(pp).toList();
@@ -36,7 +36,7 @@ String prettyPrint(object, {int maxLineLength, int maxItems}) {
// If the printed string is short and doesn't contain a newline, print it
// as a single line.
- var singleLine = "$typeName[${strings.join(', ')}]";
+ var singleLine = "$type[${strings.join(', ')}]";
if ((maxLineLength == null ||
singleLine.length + indent <= maxLineLength) &&
!singleLine.contains("\n")) {
@@ -44,7 +44,7 @@ String prettyPrint(object, {int maxLineLength, int maxItems}) {
}
// Otherwise, print each member on its own line.
- return "$typeName[\n" + strings.map((string) {
+ return "$type[\n" + strings.map((string) {
return _indent(indent + 2) + string;
}).join(",\n") + "\n" + _indent(indent) + "]";
} else if (object is Map) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698