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. |
*/ |