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

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

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 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/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() {
« no previous file with comments | « pkg/analyzer/test/generated/type_system_test.dart ('k') | pkg/analyzer/test/src/summary/package_bundle_reader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698