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

Unified Diff: pkg/analysis_server/test/domain_analysis_test.dart

Issue 545323002: Add error condition INVALID_OVERLAY_CHANGE to analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: pkg/analysis_server/test/domain_analysis_test.dart
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index bfd7ab9bfcf8bf100bc0d475655483cb62112b6d..a2d0e81a0cdb6148f6a9b8a6be0a9088678913cb 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -262,6 +262,36 @@ testUpdateContent() {
});
});
});
+
+ group('out of range', () {
+ Future outOfRangeTest(SourceEdit edit) {
+ AnalysisTestHelper helper = new AnalysisTestHelper();
+ helper.createSingleFileProject('library A;');
+ return helper.waitForOperationsFinished().then((_) {
+ helper.sendContentChange(new AddContentOverlay('library B;'));
+ return helper.waitForOperationsFinished().then((_) {
+ ChangeContentOverlay contentChange = new ChangeContentOverlay([edit]);
+ Request request = new AnalysisUpdateContentParams({
+ helper.testFile: contentChange}).toRequest('0');
+ Response response = helper.handler.handleRequest(request);
+ expect(response, isResponseFailure('0',
+ RequestErrorCode.INVALID_OVERLAY_CHANGE));
+ });
+ });
+ }
+
+ test('negative length', () {
+ return outOfRangeTest(new SourceEdit(3, -1, 'foo'));
+ });
+
+ test('negative offset', () {
+ return outOfRangeTest(new SourceEdit(-1, 3, 'foo'));
+ });
+
+ test('beyond end', () {
+ return outOfRangeTest(new SourceEdit(6, 6, 'foo'));
+ });
+ });
}
« no previous file with comments | « pkg/analysis_server/lib/src/protocol.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698