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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 2590593003: new test for analysis options include directive (Closed)
Patch Set: merge Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index db3bf030854064f63085cb6b6e6ebfe1135f4cd0..ded3532a2973faccdd36cbeda3a3c749b7f70fa3 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -2136,6 +2136,46 @@ linter:
expect(lints[0].name, 'camel_case_types');
}
+ test_analysis_options_include_package() async {
+ // Create files.
+ String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
+ newFile([libPath, 'main.dart']);
+ String sdkExtPath = newFolder([projPath, 'sdk_ext']);
+ newFile([sdkExtPath, 'entry.dart']);
+ String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
+ newFile([sdkExtSrcPath, 'part.dart']);
+ // Setup package
+ String booLibPosixPath = '/my/pkg/boo/lib';
+ newFile(
+ [booLibPosixPath, 'other_options.yaml'],
+ r'''
+analyzer:
+ language:
+ enableStrictCallChecks: true
+ errors:
+ unused_local_variable: false
+linter:
+ rules:
+ - camel_case_types
+''');
+ // Setup analysis options file which includes another options file.
+ newFile([projPath, ContextManagerImpl.PACKAGE_SPEC_NAME],
+ 'boo:$booLibPosixPath\n');
+ newFile(
+ [projPath, optionsFileName],
+ r'''
+include: package:boo/other_options.yaml
+''');
+ // Setup context.
+ manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+ await pumpEventQueue();
+ // Verify options were set.
+ expect(analysisOptions.enableStrictCallChecks, isTrue);
+ expect(errorProcessors, hasLength(1));
+ expect(lints, hasLength(1));
+ expect(lints[0].name, 'camel_case_types');
+ }
+
test_analysis_options_parse_failure() async {
// Create files.
String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698