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

Unified Diff: pkg/analysis_services/test/correction/assist_test.dart

Issue 472613002: Update analysis server and integration tests to match new ChangeContentOverlay. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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_services/test/correction/assist_test.dart
diff --git a/pkg/analysis_services/test/correction/assist_test.dart b/pkg/analysis_services/test/correction/assist_test.dart
index e32aff3cb86cffffa232870e4cc174fcd772e514..478807fd36582c80f2d455ac40e1fbcb0775ef1a 100644
--- a/pkg/analysis_services/test/correction/assist_test.dart
+++ b/pkg/analysis_services/test/correction/assist_test.dart
@@ -11,7 +11,6 @@ import 'package:analysis_services/index/local_memory_index.dart';
import 'package:analysis_services/src/search/search_engine.dart';
import 'package:analysis_testing/abstract_single_unit.dart';
import 'package:analysis_testing/reflective_tests.dart';
-import 'package:collection/collection.dart';
import 'package:unittest/unittest.dart';
@@ -44,7 +43,9 @@ class AssistProcessorTest extends AbstractSingleUnitTest {
// apply to "file"
List<FileEdit> fileEdits = change.fileEdits;
expect(fileEdits, hasLength(1));
- resultCode = _applyEdits(testCode, change.fileEdits[0].edits);
+ // TODO(paulberry): should the code under test be responsible for sorting
+ // the edits?
+ resultCode = Edit.applySorted(testCode, change.fileEdits[0].edits);
// verify
expect(resultCode, expected);
}
@@ -2189,16 +2190,6 @@ main() {
''');
}
- String _applyEdits(String code, List<Edit> edits) {
- mergeSort(edits, compare: (a, b) => a.offset - b.offset);
- edits.reversed.forEach((Edit edit) {
- code = code.substring(0, edit.offset) +
- edit.replacement +
- code.substring(edit.end);
- });
- return code;
- }
-
/**
* Computes assists and verifies that there is an assist of the given kind.
*/
« no previous file with comments | « pkg/analysis_services/lib/correction/change.dart ('k') | pkg/analysis_services/test/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698