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

Unified Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 1145443003: Issue 23477. Fix for Quick Fixes in overlay-only files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/analysis_server.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/edit/fixes_test.dart
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 7da3e75332937205a2198b98ee3b192bdde90033..396c547a2691a6034dfe8f24e896b74981b55efb 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -6,6 +6,7 @@ library test.edit.fixes;
import 'dart:async';
+import 'package:analysis_server/src/domain_analysis.dart';
import 'package:analysis_server/src/edit/edit_domain.dart';
import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analysis_server/src/protocol.dart';
@@ -14,6 +15,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
+import '../mocks.dart';
main() {
groupSep = ' | ';
@@ -77,6 +79,28 @@ bar() {
});
}
+ Future test_overlayOnlyFile() {
+ // add an overlay-only file
+ {
+ testCode = '''
+main() {
+ print(1)
+}
+''';
+ Request request = new AnalysisUpdateContentParams(
+ {testFile: new AddContentOverlay(testCode)}).toRequest('0');
+ Response response =
+ new AnalysisDomainHandler(server).handleRequest(request);
+ expect(response, isResponseSuccess('0'));
+ }
+ // ask for fixes
+ return waitForTasksFinished().then((_) {
+ List<AnalysisErrorFixes> errorFixes = _getFixesAt('print(1)');
+ expect(errorFixes, hasLength(1));
+ _isSyntacticErrorWithSingleFix(errorFixes[0]);
+ });
+ }
+
List<AnalysisErrorFixes> _getFixes(int offset) {
Request request = new EditGetFixesParams(testFile, offset).toRequest('0');
Response response = handleSuccessfulRequest(request);
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698