Add assert messages

This commit is contained in:
James Lin 2019-08-14 13:53:36 -07:00 committed by James D. Lin
parent e3ffa7689a
commit 4f3b70671c
2 changed files with 5 additions and 3 deletions

View File

@ -90,7 +90,9 @@ Future<void> runCommand(String executable, List<String> arguments, {
Duration timeout = _kLongTimeout,
bool Function(String) removeLine,
}) async {
assert((outputMode == OutputMode.capture) == (output != null));
assert((outputMode == OutputMode.capture) == (output != null),
'The output parameter must be non-null with and only with '
'OutputMode.capture');
final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}';
final String relativeWorkingDir = path.relative(workingDirectory);

View File

@ -816,8 +816,8 @@ Future<void> _runFlutterTest(String workingDirectory, {
Map<String, String> environment,
List<String> tests = const <String>[],
}) async {
// Support printing output or capturing it for matching, but not both.
assert(!printOutput || outputChecker == null);
assert(!printOutput || outputChecker == null,
'Output either can be printed or checked but not both');
final List<String> args = <String>[
'test',