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

Unified Diff: pkg/analysis_server/test/analysis/set_priority_files_test.dart

Issue 1462693002: Report error for ignored priority file. Ignore subscription for ignored files. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: pkg/analysis_server/test/analysis/set_priority_files_test.dart
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
index 770a03628f5f44def526a173b1f2269c88bac16f..f89ba308f94730263dc7ce991702bf72969349b7 100644
--- a/pkg/analysis_server/test/analysis/set_priority_files_test.dart
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -72,6 +72,58 @@ class SetPriorityFilesTest extends AbstractAnalysisTest {
expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
}
+ test_ignoredInAnalysisOptions() async {
+ String sampleFile = '$projectPath/samples/sample.dart';
+ addFile(
+ '$projectPath/.analysis_options',
+ r'''
+analyzer:
+ exclude:
+ - 'samples/**'
+''');
+ addFile(sampleFile, '');
+ // attempt to set priority file
+ Response response = await _setPriorityFile(sampleFile);
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
+ }
+
+ test_ignoredInAnalysisOptions_inChildContext() async {
+ addFile('$projectPath/.packages', '');
+ addFile('$projectPath/child/.packages', '');
+ String sampleFile = '$projectPath/child/samples/sample.dart';
+ addFile(
+ '$projectPath/child/.analysis_options',
+ r'''
+analyzer:
+ exclude:
+ - 'samples/**'
+''');
+ addFile(sampleFile, '');
+ // attempt to set priority file
+ Response response = await _setPriorityFile(sampleFile);
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
+ }
+
+ test_ignoredInAnalysisOptions_inRootContext() async {
+ addFile('$projectPath/.packages', '');
+ addFile('$projectPath/child/.packages', '');
+ String sampleFile = '$projectPath/child/samples/sample.dart';
+ addFile(
+ '$projectPath/.analysis_options',
+ r'''
+analyzer:
+ exclude:
+ - 'child/samples/**'
+''');
+ addFile(sampleFile, '');
+ // attempt to set priority file
+ Response response = await _setPriorityFile(sampleFile);
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
+ }
+
_setPriorityFile(String file) async {
Request request =
new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0');

Powered by Google App Engine
This is Rietveld 408576698