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

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

Issue 1798223002: Fix visible range of local variables in 'for' loops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/lib/src/dart/element/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/refactoring/rename_local_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
index a92bd0d4d483838350280b15b636d9c82b85d8fe..e454ecec3c28b5b2f89fde5d2a3bd532ab6e8351 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -101,6 +101,32 @@ main() {
return assertRefactoringConditionsOK();
}
+ test_checkFinalConditions_hasLocalVariable_otherForEachLoop() {
+ indexTestUnit('''
+main() {
+ for (int newName in []) {}
+ for (int test in []) {}
+}
+''');
+ createRenameRefactoringAtString('test in');
+ // check status
+ refactoring.newName = 'newName';
+ return assertRefactoringConditionsOK();
+ }
+
+ test_checkFinalConditions_hasLocalVariable_otherForLoop() {
+ indexTestUnit('''
+main() {
+ for (int newName = 0; newName < 10; newName++) {}
+ for (int test = 0; test < 10; test++) {}
+}
+''');
+ createRenameRefactoringAtString('test = 0');
+ // check status
+ refactoring.newName = 'newName';
+ return assertRefactoringConditionsOK();
+ }
+
test_checkFinalConditions_hasLocalVariable_otherFunction() {
indexTestUnit('''
main() {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698