Unverified Commit 33c0f274 authored by Sam Rawlins's avatar Sam Rawlins Committed by GitHub

Prepare the analyze_once test for removal of analysis_options_user support (#138229)

Fixes https://github.com/flutter/flutter/issues/138227. Work towards https://github.com/flutter/flutter/issues/82948

In https://github.com/dart-lang/sdk/commit/c033718da0502ed92609f8c6cee2f6a59ccc058e, the analyzer's support for `analysis_options_user.yaml` is dropped. So no lint is reported in this test, as expected. This PR changes the test to expect no lint, and also no write the edits that trigger the lint.
parent cdc873ec
......@@ -164,16 +164,10 @@ void main() {
// Analyze in the current directory - no arguments
testWithoutContext('working directory with errors', () async {
// Break the code to produce the "Avoid empty else" hint
// that is upgraded to a warning in package:flutter/analysis_options_user.yaml
// to assert that we are using the default Flutter analysis options.
// Break the code to produce an error and a warning.
// Also insert a statement that should not trigger a lint here
// but will trigger a lint later on when an analysis_options.yaml is added.
String source = await libMain.readAsString();
source = source.replaceFirst(
'return MaterialApp(',
'if (debugPrintRebuildDirtyWidgets) {} else ; return MaterialApp(',
);
source = source.replaceFirst(
'onPressed: _incrementCounter,',
'// onPressed: _incrementCounter,',
......@@ -189,12 +183,12 @@ void main() {
arguments: <String>['analyze', '--no-pub'],
statusTextContains: <String>[
'Analyzing',
'avoid_empty_else',
'empty_statements',
'unused_element',
'missing_required_param',
],
exitMessageContains: '4 issues found.',
// TODO(srawlins): Assert with `exitMessageContains: '2 issues found.',` after
// https://github.com/dart-lang/sdk/commit/c033718da0502ed92609f8c6cee2f6a59ccc058e
// rolls into this repo.
exitCode: 1,
);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment