Index: pkg/analysis_server/test/analysis/update_content_test.dart |
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart |
index 3e096320dea437e4f782285ffe51403af26896fe..7ca1fba2bbf8f576bd956a6b7d73a711dc8f5d72 100644 |
--- a/pkg/analysis_server/test/analysis/update_content_test.dart |
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart |
@@ -42,7 +42,8 @@ class UpdateContentTest extends AbstractAnalysisTest { |
void processNotification(Notification notification) { |
if (notification.event == ANALYSIS_ERRORS) { |
var decoded = new AnalysisErrorsParams.fromNotification(notification); |
- filesErrors[decoded.file] = decoded.errors; |
+ _format(AnalysisError e) => "${e.location.startLine}: ${e.message}"; |
+ filesErrors[decoded.file] = decoded.errors.map(_format).toList(); |
} |
if (notification.event == ANALYSIS_NAVIGATION) { |
navigationCount++; |
@@ -188,6 +189,29 @@ f() {} |
expect(_getUserSources(context2), isEmpty); |
} |
+ test_overlay_addPreviouslyImported() async { |
+ Folder project = resourceProvider.newFolder('/project'); |
+ handleSuccessfulRequest( |
+ new AnalysisSetAnalysisRootsParams([project.path], []).toRequest('0')); |
+ |
+ server.updateContent('1', |
+ {'/project/main.dart': new AddContentOverlay('import "target.dart";')}); |
+ await server.onAnalysisComplete; |
+ expect(filesErrors, { |
+ '/project/main.dart': ["1: Target of URI does not exist: 'target.dart'"], |
+ '/project/target.dart': [] |
+ }); |
+ |
+ server.updateContent('1', |
+ {'/project/target.dart': new AddContentOverlay('import "none.dart";')}); |
+ await server.onAnalysisComplete; |
+ expect(filesErrors, { |
+ '/project/main.dart': ["1: Unused import"], |
+ '/project/target.dart': ["1: Target of URI does not exist: 'none.dart'"], |
+ '/project/none.dart': [] |
+ }); |
+ } |
+ |
test_removeOverlay_incrementalChange() async { |
createProject(); |
addTestFile('main() { print(1); }'); |