From 08374a5f448074c0f327aea5a05b66031acd3ec1 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 5 Jun 2023 16:20:38 -0400 Subject: [PATCH] [tools] Fix OOB test error (#4144) An update to `args` changed the failure mode for a missing flag; this updates the tests accordingly to fix the tree. --- .../tool/test/update_min_sdk_command_test.dart | 6 +++--- .../test/update_release_info_command_test.dart | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/script/tool/test/update_min_sdk_command_test.dart b/script/tool/test/update_min_sdk_command_test.dart index 91387489f3..8334ebb540 100644 --- a/script/tool/test/update_min_sdk_command_test.dart +++ b/script/tool/test/update_min_sdk_command_test.dart @@ -28,14 +28,14 @@ void main() { }); test('fails if --flutter-min is missing', () async { - Exception? commandError; + Error? commandError; await runCapturingPrint(runner, [ 'update-min-sdk', - ], exceptionHandler: (Exception e) { + ], errorHandler: (Error e) { commandError = e; }); - expect(commandError, isA()); + expect(commandError, isA()); }); test('updates Dart when only Dart is present', () async { diff --git a/script/tool/test/update_release_info_command_test.dart b/script/tool/test/update_release_info_command_test.dart index 0981a85f62..d21a1367d2 100644 --- a/script/tool/test/update_release_info_command_test.dart +++ b/script/tool/test/update_release_info_command_test.dart @@ -50,15 +50,15 @@ void main() { group('flags', () { test('fails if --changelog is missing', () async { - Exception? commandError; + Error? commandError; await runCapturingPrint(runner, [ 'update-release-info', '--version=next', - ], exceptionHandler: (Exception e) { + ], errorHandler: (Error e) { commandError = e; }); - expect(commandError, isA()); + expect(commandError, isA()); }); test('fails if --changelog is blank', () async { @@ -76,14 +76,14 @@ void main() { }); test('fails if --version is missing', () async { - Exception? commandError; + Error? commandError; await runCapturingPrint( - runner, ['update-release-info', '--changelog', ''], - exceptionHandler: (Exception e) { + runner, ['update-release-info', '--changelog', 'A change.'], + errorHandler: (Error e) { commandError = e; }); - expect(commandError, isA()); + expect(commandError, isA()); }); test('fails if --version is an unknown value', () async { @@ -92,7 +92,7 @@ void main() { 'update-release-info', '--version=foo', '--changelog', - '', + 'A change.', ], exceptionHandler: (Exception e) { commandError = e; });