Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: pkg/analysis_server/test/integration/analysis/analysis_options_test.dart

Issue 1975963002: Support the name analysis_options.yaml for analysis options files (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
index 33ad500771fbe65f492589ec4bd3eb0510bb1746..4c55f8255de10aacad45ad0ecb6df884da7d33dd 100644
--- a/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
@@ -2,9 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library test.integration.analysis.analysis_options;
+library test.integration.analysis.analysis_options_test;
import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analyzer/src/generated/engine.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
@@ -18,8 +19,35 @@ main() {
@reflectiveTest
class OptionsIntegrationTest extends AbstractAnalysisServerIntegrationTest {
- test_option_warning() async {
- String options = sourcePath('.analysis_options');
+ test_option_warning_newOptionFile() async {
+ String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
+ writeFile(
+ options,
+ '''
+linter:
+ rules:
+ - camel_case_typo # :)
+''');
+
+ standardAnalysisSetup();
+
+ await analysisFinished;
+
+ expect(currentAnalysisErrors[options], isList);
+ List<AnalysisError> errors = currentAnalysisErrors[options];
+ expect(errors, hasLength(1));
+ AnalysisError error = errors[0];
+ expect(error.location.file, options);
+ expect(error.severity, AnalysisErrorSeverity.WARNING);
+ expect(error.type, AnalysisErrorType.STATIC_WARNING);
+ expect(error.location.offset, 23);
+ expect(error.location.length, 'camel_case_typo'.length);
+ expect(error.location.startLine, 3);
+ expect(error.location.startColumn, 7);
+ }
+
+ test_option_warning_oldOptionFile() async {
+ String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_FILE);
writeFile(
options,
'''

Powered by Google App Engine
This is Rietveld 408576698