From 4f3b70671ca4fc4a66a41a7eebb3bdf51619ca13 Mon Sep 17 00:00:00 2001 From: James Lin Date: Wed, 14 Aug 2019 13:53:36 -0700 Subject: [PATCH] Add assert messages --- dev/bots/run_command.dart | 4 +++- dev/bots/test.dart | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/bots/run_command.dart b/dev/bots/run_command.dart index 93ce567023..6d3301d373 100644 --- a/dev/bots/run_command.dart +++ b/dev/bots/run_command.dart @@ -90,7 +90,9 @@ Future runCommand(String executable, List 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); diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 2901fc13d3..c546075ce7 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -816,8 +816,8 @@ Future _runFlutterTest(String workingDirectory, { Map environment, List tests = const [], }) 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 args = [ 'test',