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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 2997073002: Correctly update positions when adding edits before them (issue 30444) (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index c8801213929ed53b4dcfd8e0266bf85ee294b361..42f4d3dacebe5110e9f5422f3e96a138052108eb 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -2544,6 +2544,18 @@ main() {
new C(a, b);
}
''');
+
+ List<LinkedEditGroup> groups = change.linkedEditGroups;
+ expect(groups, hasLength(2));
+ LinkedEditGroup typeGroup = groups[0];
+ List<Position> typePositions = typeGroup.positions;
+ expect(typePositions, hasLength(1));
+ expect(typePositions[0].offset, 112);
+ LinkedEditGroup nameGroup = groups[1];
+ List<Position> groupPositions = nameGroup.positions;
+ expect(groupPositions, hasLength(2));
+ expect(groupPositions[0].offset, 114);
+ expect(groupPositions[1].offset, 128);
}
test_createLocalVariable_write_assignment() async {
« no previous file with comments | « no previous file | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698