| 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 9dfd14eba9f1dcfcc92fc1a5cfc994bda449a508..4994fd57a0009a1085d28315a156db5ccf39c8b1 100644
|
| --- a/pkg/analyzer/test/src/context/builder_test.dart
|
| +++ b/pkg/analyzer/test/src/context/builder_test.dart
|
| @@ -815,6 +815,26 @@ analyzer:
|
| _expectEqualOptions(options, expected);
|
| }
|
|
|
| + void test_getAnalysisOptions_gnWorkspace() {
|
| + String _p(String path) => resourceProvider.convertPath(path);
|
| + String projectPath = _p('/workspace/some/path');
|
| + resourceProvider.newFolder(_p('/workspace/.jiri_root'));
|
| + resourceProvider.newFile(
|
| + _p('/workspace/out/debug/gen/dart.sources/foo_pkg'),
|
| + _p('/workspace/foo_pkg/lib'));
|
| + resourceProvider.newFolder(projectPath);
|
| + ArgParser argParser = new ArgParser();
|
| + defineAnalysisArguments(argParser);
|
| + ArgResults argResults = argParser.parse([]);
|
| + builderOptions = createContextBuilderOptions(argResults);
|
| + expect(builderOptions.packageDefaultAnalysisOptions, isTrue);
|
| + builder = new ContextBuilder(resourceProvider, sdkManager, contentCache,
|
| + options: builderOptions);
|
| + AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
|
| + AnalysisOptions options = builder.getAnalysisOptions(projectPath);
|
| + _expectEqualOptions(options, expected);
|
| + }
|
| +
|
| void test_getAnalysisOptions_includes() {
|
| _defineMockLintRules();
|
| AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
|
| @@ -893,23 +913,6 @@ linter:
|
| _expectEqualOptions(options, new AnalysisOptionsImpl());
|
| }
|
|
|
| - void test_getAnalysisOptions_optionsPath() {
|
| - String path = resourceProvider.convertPath('/some/directory/path');
|
| - String filePath =
|
| - pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
|
| - resourceProvider.newFile(
|
| - filePath,
|
| - '''
|
| -linter:
|
| - rules:
|
| - - empty_constructor_bodies
|
| -''');
|
| -
|
| - ContextRoot root = new ContextRoot(path, []);
|
| - builder.getAnalysisOptions(path, contextRoot: root);
|
| - expect(root.optionsFilePath, equals(filePath));
|
| - }
|
| -
|
| void test_getAnalysisOptions_noDefault_overrides() {
|
| AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
|
| expected.enableSuperMixins = true;
|
| @@ -928,24 +931,21 @@ analyzer:
|
| _expectEqualOptions(options, expected);
|
| }
|
|
|
| - void test_getAnalysisOptions_gnWorkspace() {
|
| - String _p(String path) => resourceProvider.convertPath(path);
|
| - String projectPath = _p('/workspace/some/path');
|
| - resourceProvider.newFolder(_p('/workspace/.jiri_root'));
|
| + void test_getAnalysisOptions_optionsPath() {
|
| + String path = resourceProvider.convertPath('/some/directory/path');
|
| + String filePath =
|
| + pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
|
| resourceProvider.newFile(
|
| - _p('/workspace/out/debug/gen/dart.sources/foo_pkg'),
|
| - _p('/workspace/foo_pkg/lib'));
|
| - resourceProvider.newFolder(projectPath);
|
| - ArgParser argParser = new ArgParser();
|
| - defineAnalysisArguments(argParser);
|
| - ArgResults argResults = argParser.parse([]);
|
| - builderOptions = createContextBuilderOptions(argResults);
|
| - expect(builderOptions.packageDefaultAnalysisOptions, isTrue);
|
| - builder = new ContextBuilder(resourceProvider, sdkManager, contentCache,
|
| - options: builderOptions);
|
| - AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
|
| - AnalysisOptions options = builder.getAnalysisOptions(projectPath);
|
| - _expectEqualOptions(options, expected);
|
| + filePath,
|
| + '''
|
| +linter:
|
| + rules:
|
| + - empty_constructor_bodies
|
| +''');
|
| +
|
| + ContextRoot root = new ContextRoot(path, []);
|
| + builder.getAnalysisOptions(path, contextRoot: root);
|
| + expect(root.optionsFilePath, equals(filePath));
|
| }
|
|
|
| void test_getOptionsFile_explicit() {
|
|
|