| Index: pkg/analysis_server/test/edit/refactoring_test.dart
|
| diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
|
| index 575e07b7377185bc8573b46d37531bca2b8cd0fb..c6133b89113b2bf6cf6e556b9f98e857967319ea 100644
|
| --- a/pkg/analysis_server/test/edit/refactoring_test.dart
|
| +++ b/pkg/analysis_server/test/edit/refactoring_test.dart
|
| @@ -1044,6 +1044,39 @@ main() {
|
| "Duplicate local variable 'newName'.");
|
| });
|
| }
|
| +
|
| + test_resetOnAnalysis() {
|
| + addTestFile('''
|
| +main() {
|
| + int initialName = 0;
|
| + print(initialName);
|
| +}
|
| +''');
|
| + // send the first request
|
| + return getRefactoringResult(() {
|
| + return sendRenameRequest('initialName =', 'newName', true);
|
| + }).then((result) {
|
| + RenameFeedback feedback = result.feedback;
|
| + expect(feedback.oldName, 'initialName');
|
| + // update the file
|
| + modifyTestFile('''
|
| +main() {
|
| + int otherName = 0;
|
| + print(otherName);
|
| +}
|
| +''');
|
| + // send the second request, with the same kind, file and offset
|
| + return waitForTasksFinished().then((_) {
|
| + return getRefactoringResult(() {
|
| + return sendRenameRequest('otherName =', 'newName', true);
|
| + }).then((result) {
|
| + RenameFeedback feedback = result.feedback;
|
| + // the refactoring was reset, so we don't get a stale result
|
| + expect(feedback.oldName, 'otherName');
|
| + });
|
| + });
|
| + });
|
| + }
|
| }
|
|
|
|
|
|
|