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

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

Issue 2664893003: improve analysis options include test (Closed)
Patch Set: merge Created 3 years, 11 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
« 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/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 1e9ca1c06ea362e0621c38d8babdf6d4838310ab..1f9297717af1cf28a67d372a23325071108d3061 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -633,14 +633,26 @@ analyzer:
}
void test_getAnalysisOptions_includes() {
+ MockLintRule mockLintRule = new MockLintRule('mock_lint_rule');
+ Registry.ruleRegistry.register(mockLintRule);
+ MockLintRule mockLintRule2 = new MockLintRule('mock_lint_rule2');
+ Registry.ruleRegistry.register(mockLintRule2);
+ MockLintRule mockLintRule3 = new MockLintRule('mock_lint_rule3');
+ Registry.ruleRegistry.register(mockLintRule3);
+
AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
+ defaultOptions.enableSuperMixins = false;
builderOptions.defaultOptions = defaultOptions;
AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
expected.enableSuperMixins = true;
+ expected.lint = true;
+ expected.lintRules = <Linter>[mockLintRule, mockLintRule2, mockLintRule3];
resourceProvider.newFile(
resourceProvider.convertPath('/mypkgs/somepkg/lib/here.yaml'),
'''
-two: {boo: newt}
+linter:
+ rules:
+ - mock_lint_rule3
''');
String path = resourceProvider.convertPath('/some/directory/path');
resourceProvider.newFile(
@@ -652,7 +664,12 @@ somepkg:../../../mypkgs/somepkg/lib
pathContext.join(path, 'bar.yaml'),
'''
include: package:somepkg/here.yaml
-foo: {bar: baz}
+analyzer:
+ language:
+ enableSuperMixins : true
+linter:
+ rules:
+ - mock_lint_rule2
''');
String filePath =
pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
@@ -660,9 +677,9 @@ foo: {bar: baz}
filePath,
'''
include: bar.yaml
-analyzer:
- language:
- enableSuperMixins : true
+linter:
+ rules:
+ - mock_lint_rule
''');
AnalysisOptions options = builder.getAnalysisOptions(path);
« 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