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

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

Issue 2980653002: Don't include *.yaml files in 'analysis.analyzedFiles' notification. (Closed)
Patch Set: Created 3 years, 5 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 | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
index bddfea4d62426760c7c5b051a8f3db26d93706fb..c7a11964eaa754dce5b1c2a1154030116241d7d0 100644
--- a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
@@ -7,6 +7,7 @@ import 'dart:async';
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_constants.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
+import 'package:analyzer/file_system/file_system.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -29,6 +30,11 @@ class AnalysisNotificationAnalyzedFilesTest extends AbstractAnalysisTest {
expect(analyzedFiles, contains(filePath));
}
+ void assertHasNoFile(String filePath) {
+ expect(analyzedFilesReceived, isTrue);
+ expect(analyzedFiles, isNot(contains(filePath)));
+ }
+
Future<Null> prepareAnalyzedFiles() async {
addGeneralAnalysisSubscription(GeneralAnalysisService.ANALYZED_FILES);
await pumpEventQueue();
@@ -66,6 +72,19 @@ class A {}
assertHasFile(testFile);
}
+ test_beforeAnalysis_excludeYamlFiles() async {
+ File yamlFile = resourceProvider
+ .getFolder(projectPath)
+ .getChildAssumingFile('sample.yaml');
+ yamlFile.writeAsStringSync('');
+ addTestFile('''
+class A {}
+''');
+ await prepareAnalyzedFiles();
+ assertHasFile(testFile);
+ assertHasNoFile(yamlFile.path);
+ }
+
test_insignificant_change() async {
// Making a change that doesn't affect the set of reachable files should
// not trigger the notification to be re-sent.
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698