mirror of
https://github.com/flutter/packages.git
synced 2025-06-30 06:37:17 +08:00
[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:
@ -28,14 +28,14 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('fails if --flutter-min is missing', () async {
|
test('fails if --flutter-min is missing', () async {
|
||||||
Exception? commandError;
|
Error? commandError;
|
||||||
await runCapturingPrint(runner, <String>[
|
await runCapturingPrint(runner, <String>[
|
||||||
'update-min-sdk',
|
'update-min-sdk',
|
||||||
], exceptionHandler: (Exception e) {
|
], errorHandler: (Error e) {
|
||||||
commandError = e;
|
commandError = e;
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(commandError, isA<UsageException>());
|
expect(commandError, isA<ArgumentError>());
|
||||||
});
|
});
|
||||||
|
|
||||||
test('updates Dart when only Dart is present', () async {
|
test('updates Dart when only Dart is present', () async {
|
||||||
|
@ -50,15 +50,15 @@ void main() {
|
|||||||
|
|
||||||
group('flags', () {
|
group('flags', () {
|
||||||
test('fails if --changelog is missing', () async {
|
test('fails if --changelog is missing', () async {
|
||||||
Exception? commandError;
|
Error? commandError;
|
||||||
await runCapturingPrint(runner, <String>[
|
await runCapturingPrint(runner, <String>[
|
||||||
'update-release-info',
|
'update-release-info',
|
||||||
'--version=next',
|
'--version=next',
|
||||||
], exceptionHandler: (Exception e) {
|
], errorHandler: (Error e) {
|
||||||
commandError = e;
|
commandError = e;
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(commandError, isA<UsageException>());
|
expect(commandError, isA<ArgumentError>());
|
||||||
});
|
});
|
||||||
|
|
||||||
test('fails if --changelog is blank', () async {
|
test('fails if --changelog is blank', () async {
|
||||||
@ -76,14 +76,14 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('fails if --version is missing', () async {
|
test('fails if --version is missing', () async {
|
||||||
Exception? commandError;
|
Error? commandError;
|
||||||
await runCapturingPrint(
|
await runCapturingPrint(
|
||||||
runner, <String>['update-release-info', '--changelog', ''],
|
runner, <String>['update-release-info', '--changelog', 'A change.'],
|
||||||
exceptionHandler: (Exception e) {
|
errorHandler: (Error e) {
|
||||||
commandError = e;
|
commandError = e;
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(commandError, isA<UsageException>());
|
expect(commandError, isA<ArgumentError>());
|
||||||
});
|
});
|
||||||
|
|
||||||
test('fails if --version is an unknown value', () async {
|
test('fails if --version is an unknown value', () async {
|
||||||
@ -92,7 +92,7 @@ void main() {
|
|||||||
'update-release-info',
|
'update-release-info',
|
||||||
'--version=foo',
|
'--version=foo',
|
||||||
'--changelog',
|
'--changelog',
|
||||||
'',
|
'A change.',
|
||||||
], exceptionHandler: (Exception e) {
|
], exceptionHandler: (Exception e) {
|
||||||
commandError = e;
|
commandError = e;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user