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

Unified Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 589843002: Reset refactoring manager on any analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « pkg/analysis_server/test/analysis_abstract.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
+ });
+ });
+ });
+ }
}
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698