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

Unified Diff: test/utils.dart

Issue 945583004: If no paths are provided, read source from stdin. Fix #165. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 10 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 | « test/command_line_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/utils.dart
diff --git a/test/utils.dart b/test/utils.dart
index de8db01ed81ab6229d6025a3d63d8c6d0e62be6f..56b7d7ddd8e960670c76437e6c3d01ad0bcb6585 100644
--- a/test/utils.dart
+++ b/test/utils.dart
@@ -15,16 +15,24 @@ import 'package:unittest/compact_vm_config.dart';
const unformattedSource = 'void main() => print("hello") ;';
const formattedSource = 'void main() => print("hello");\n';
+/// Runs the command line formatter, passing it [args].
ScheduledProcess runFormatter([List<String> args]) {
if (args == null) args = [];
var formatterPath = p.join(
p.dirname(p.fromUri(Platform.script)), "..", "bin", "format.dart");
- args.insertAll(0, [formatterPath, d.defaultRoot]);
+ args.insert(0, formatterPath);
return new ScheduledProcess.start(Platform.executable, args);
}
+/// Runs the command line formatter, passing it the test directory followed by
+/// [args].
+ScheduledProcess runFormatterOnDir([List<String> args]) {
+ if (args == null) args = [];
+ return runFormatter([d.defaultRoot]..addAll(args));
+}
+
/// Set up the scheduled test suite.
///
/// Configures the unit test output and makes a sandbox directory for the
« no previous file with comments | « test/command_line_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698