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 |