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

Unified Diff: pkg/analysis_services/test/correction/fix_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/fix_test.dart
diff --git a/pkg/analysis_services/test/correction/fix_test.dart b/pkg/analysis_services/test/correction/fix_test.dart
index 3d672fc96c6e008fa8ef229e058aa77268558015..476f3196e9faf4d0ca7486f2eb8a1af62db059f5 100644
--- a/pkg/analysis_services/test/correction/fix_test.dart
+++ b/pkg/analysis_services/test/correction/fix_test.dart
@@ -41,7 +41,9 @@ class FixProcessorTest 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);
}
@@ -1799,16 +1801,6 @@ main() {
''');
}
- String _applyEdits(String code, List<Edit> edits) {
- edits.sort((a, b) => b.offset - a.offset);
- edits.forEach((Edit edit) {
- code = code.substring(0, edit.offset) +
- edit.replacement +
- code.substring(edit.end);
- });
- return code;
- }
-
/**
* Computes fixes and verifies that there is a fix of the given kind.
*/
« no previous file with comments | « pkg/analysis_services/test/correction/assist_test.dart ('k') | pkg/analysis_services/test/refactoring/abstract_rename.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698