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. |