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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_local_test.dart

Issue 619723002: Fix for 'Extract Local' refactoring - take into account local variable elements. (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/lib/src/services/refactoring/extract_local.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/services/refactoring/extract_local_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
index 6f657583c753b50bf5aa195d0a201653b9faa082..7ba11241c5118f578a9f2c1d7d3001579d41c1e2 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -596,6 +596,38 @@ main() {
''');
}
+ test_occurences_differentVariable() {
+ indexTestUnit('''
+main() {
+ {
+ int v = 1;
+ print(v + 1); // marker
+ print(v + 1);
+ }
+ {
+ int v = 2;
+ print(v + 1);
+ }
+}
+''');
+ _createRefactoringWithSuffix('v + 1', '); // marker');
+ // apply refactoring
+ return _assertSuccessfulRefactoring('''
+main() {
+ {
+ int v = 1;
+ var res = v + 1;
+ print(res); // marker
+ print(res);
+ }
+ {
+ int v = 2;
+ print(v + 1);
+ }
+}
+''');
+ }
+
test_occurences_useDominator() {
indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_local.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698