[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.
This commit is contained in:
stuartmorgan
2023-06-05 16:20:38 -04:00
committed by GitHub
parent 145ed2c6ab
commit 08374a5f44
2 changed files with 11 additions and 11 deletions

View File

@ -28,14 +28,14 @@ void main() {
});
test('fails if --flutter-min is missing', () async {
Exception? commandError;
Error? commandError;
await runCapturingPrint(runner, <String>[
'update-min-sdk',
], exceptionHandler: (Exception e) {
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<UsageException>());
expect(commandError, isA<ArgumentError>());
});
test('updates Dart when only Dart is present', () async {

View File

@ -50,15 +50,15 @@ void main() {
group('flags', () {
test('fails if --changelog is missing', () async {
Exception? commandError;
Error? commandError;
await runCapturingPrint(runner, <String>[
'update-release-info',
'--version=next',
], exceptionHandler: (Exception e) {
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<UsageException>());
expect(commandError, isA<ArgumentError>());
});
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, <String>['update-release-info', '--changelog', ''],
exceptionHandler: (Exception e) {
runner, <String>['update-release-info', '--changelog', 'A change.'],
errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<UsageException>());
expect(commandError, isA<ArgumentError>());
});
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;
});