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

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

Issue 1052243003: Issue 23081. Fix for inlining into IndexExpression index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « pkg/analysis_server/lib/src/services/correction/util.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/inline_local_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
index 1e646ffd2319a99dd1d3d92e6ae6c5664eeaadb0..2a3c104e60135817c64dd414107a5e488081d003 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
@@ -534,6 +534,42 @@ main() {
''');
}
+ test_OK_parenthesis_intoIndexExpression_index() {
+ indexTestUnit('''
+main() {
+ var items = [];
+ var test = 1 + 2;
+ items[test] * 5;
+}
+''');
+ _createRefactoring('test =');
+ // validate change
+ return assertSuccessfulRefactoring('''
+main() {
+ var items = [];
+ items[1 + 2] * 5;
+}
+''');
+ }
+
+ test_OK_parenthesis_intoParenthesizedExpression() {
+ indexTestUnit('''
+f(m, x, y) {
+ int test = x as int;
+ m[test] = y;
+ return m[test];
+}
+''');
+ _createRefactoring('test =');
+ // validate change
+ return assertSuccessfulRefactoring('''
+f(m, x, y) {
+ m[x as int] = y;
+ return m[x as int];
+}
+''');
+ }
+
test_OK_parenthesis_negate_intoNegate() {
indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698