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

Unified Diff: pkg/scheduled_test/lib/src/schedule.dart

Issue 12853005: Change the way Patterns work in scheduled_test/descriptor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 9 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 | « pkg/scheduled_test/lib/src/descriptor/utils.dart ('k') | pkg/scheduled_test/lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/schedule.dart
diff --git a/pkg/scheduled_test/lib/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
index ddad01c0463621a0e2fa1a794fdc68fed4d0e7a5..c4777315a557ff5d7bffe30d79243fd6c51fc636 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -13,6 +13,7 @@ import 'mock_clock.dart' as mock_clock;
import 'schedule_error.dart';
import 'substitute_future.dart';
import 'task.dart';
+import 'utils.dart';
import 'value_future.dart';
/// The schedule of tasks to run for a single test. This has three separate task
@@ -528,14 +529,11 @@ class TaskQueue {
String generateTree([Task highlight]) {
assert(highlight == null || highlight.queue == this);
return _contents.map((task) {
- var lines = task.toString().split("\n");
- var firstLine = task == highlight ?
- "> ${lines.first}" : "* ${lines.first}";
- lines = new List.from(lines.skip(1).map((line) => "| $line"));
- lines.insertRange(0, 1, firstLine);
+ var taskString = prefixLines(task.toString(),
+ firstPrefix: task == highlight ? "> " : "* ");
if (task == highlight && !task.children.isEmpty) {
- for (var child in task.children) {
+ var childrenString = task.children.map((child) {
var prefix = ">";
if (child.state == TaskState.ERROR) {
prefix = "X";
@@ -543,13 +541,13 @@ class TaskQueue {
prefix = "*";
}
- var childLines = child.toString().split("\n");
- lines.add(" $prefix ${childLines.first}");
- lines.addAll(childLines.skip(1).map((line) => " | $line"));
- }
+ return prefixLines(child.toString(),
+ firstPrefix: " $prefix ", prefix: " | ");
+ }).join('\n');
+ taskString = '$taskString\n$childrenString';
}
- return lines.join("\n");
+ return taskString;
}).join("\n");
}
}
« no previous file with comments | « pkg/scheduled_test/lib/src/descriptor/utils.dart ('k') | pkg/scheduled_test/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698