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

Unified Diff: pkg/analyzer/test/src/context/builder_test.dart

Issue 2505753002: integrate analysis options include directive into context builder (Closed)
Patch Set: merge Created 4 years, 1 month 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 | « pkg/analyzer/lib/src/context/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/builder_test.dart
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index b05daa5240fa47b4906d6e9560c70d844c250714..8a40454ad61b73cee2dfae54efb98a382a449f15 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -555,6 +555,63 @@ analyzer:
}
}
+ void test_getAnalysisOptions_includes() {
+ AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+ defaultOptions.enableGenericMethods = true;
+ builderOptions.defaultOptions = defaultOptions;
+ AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
+ expected.enableSuperMixins = true;
+ expected.enableGenericMethods = true;
+ resourceProvider.newFile(
+ resourceProvider.convertPath('/mypkgs/somepkg/lib/here.yaml'),
+ '''
+two: {boo: newt}
+''');
+ String path = resourceProvider.convertPath('/some/directory/path');
+ resourceProvider.newFile(
+ pathContext.join(path, '.packages'),
+ '''
+somepkg:/mypkgs/somepkg/lib
+''');
+ resourceProvider.newFile(
+ pathContext.join(path, 'bar.yaml'),
+ '''
+include: package:somepkg/here.yaml
+foo: {bar: baz}
+''');
+ String filePath =
+ pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
+ resourceProvider.newFile(
+ filePath,
+ '''
+include: bar.yaml
+analyzer:
+ language:
+ enableSuperMixins : true
+''');
+
+ AnalysisEngine engine = AnalysisEngine.instance;
+ OptionsPlugin plugin = engine.optionsPlugin;
+ plugin.registerExtensionPoints((_) {});
+ try {
+ _TestOptionsProcessor processor = new _TestOptionsProcessor();
+ processor.expectedOptions = <String, Object>{
+ 'analyzer': {
+ 'language': {'enableSuperMixins': true}
+ },
+ 'foo': {'bar': 'baz'},
+ 'two': {'boo': 'newt'},
+ };
+ (plugin.optionsProcessorExtensionPoint as ExtensionPointImpl)
+ .add(processor);
+ AnalysisContext context = engine.createAnalysisContext();
+ AnalysisOptions options = builder.getAnalysisOptions(context, path);
+ _expectEqualOptions(options, expected);
+ } finally {
+ plugin.registerExtensionPoints((_) {});
+ }
+ }
+
void test_getAnalysisOptions_invalid() {
String path = resourceProvider.convertPath('/some/directory/path');
String filePath =
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698