Deprecate these old APIs (#116793)

Deprecate these old APIs
This commit is contained in:
Ian Hickson
2023-04-06 12:53:50 -07:00
committed by GitHub
parent 54e600049f
commit 806c1f8186
16 changed files with 113 additions and 81 deletions

View File

@@ -100,3 +100,8 @@ void test17() { }
'This feature was deprecated after v2.1.0-11.0.pre.'
)
void test18() { }
@Deprecated( // flutter_ignore: deprecation_syntax, https://github.com/flutter/flutter/issues/000000
'Missing the version line. '
)
void test19() { }

View File

@@ -45,13 +45,13 @@ void main() {
test('analyze.dart - verifyDeprecations', () async {
final String result = await capture(() => verifyDeprecations(testRootPath, minimumMatches: 2), shouldHaveErrors: true);
final String lines = <String>[
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:12: Deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:12: Deprecation notice does not match required pattern. There might be a missing space character at the end of the line.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:18: Deprecation notice should be a grammatically correct sentence and start with a capital letter; see style guide: STYLE_GUIDE_URL',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:25: Deprecation notice should be a grammatically correct sentence and end with a period.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:25: Deprecation notice should be a grammatically correct sentence and end with a period; notice appears to be "Also bad grammar".',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:29: Deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:32: Deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:37: Deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:41: Deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:37: Deprecation notice does not match required pattern. It might be missing the line saying "This feature was deprecated after...".',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:41: Deprecation notice does not match required pattern. There might not be an explanatory message.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:48: End of deprecation notice does not match required pattern.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:51: Unexpected deprecation notice indent.',
'║ test/analyze-test-input/root/packages/foo/deprecation.dart:70: Deprecation notice does not accurately indicate a beta branch version number; please see RELEASES_URL to find the latest beta build version number.',

View File

@@ -118,7 +118,7 @@ void main() async {
),
],
);
await runProcessWithValidations(command, '', processManager: processManager);
await runProcessWithValidations(command, '', processManager: processManager, verbose: false);
expect(processManager, hasNoRemainingExpectations);
});
@@ -133,7 +133,7 @@ void main() async {
],
);
try {
await runProcessWithValidations(command, '', processManager: processManager);
await runProcessWithValidations(command, '', processManager: processManager, verbose: false);
throw Exception('Exception was not thrown');
} on CommandException catch (e) {
expect(e, isA<Exception>());