From 40507c08cfdbb53073fad6e84e70ed5cd1e5031e Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 5 Jun 2023 14:59:21 -0400 Subject: [PATCH 1/2] [tools] Fix OOB test error An update to `args` changed the failure mode for a missing flag; this updates the tests accordingly to fix the tree. --- script/tool/test/update_min_sdk_command_test.dart | 6 +++--- script/tool/test/update_release_info_command_test.dart | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/tool/test/update_min_sdk_command_test.dart b/script/tool/test/update_min_sdk_command_test.dart index 91387489f35..8334ebb540b 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 0981a85f62e..9f23ff3c601 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 { From 1b5982c1df9618535b3f471a1de76ce2e58814af Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 5 Jun 2023 15:38:35 -0400 Subject: [PATCH 2/2] Fix tests that had blank changelogs --- script/tool/test/update_release_info_command_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/tool/test/update_release_info_command_test.dart b/script/tool/test/update_release_info_command_test.dart index 9f23ff3c601..d21a1367d2c 100644 --- a/script/tool/test/update_release_info_command_test.dart +++ b/script/tool/test/update_release_info_command_test.dart @@ -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; });