| Index: pkg/analysis_server/test/services/correction/fix_test.dart
|
| diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| index 9af602c2d9f443e795616c033243442c609844c4..132ce52fea3e4eabf86780f1a1f89e50cf652b1a 100644
|
| --- a/pkg/analysis_server/test/services/correction/fix_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| @@ -623,6 +623,81 @@ import 'my_file.dart';
|
| expect(fileEdit.edits[0].replacement, contains('library my.file;'));
|
| }
|
|
|
| + void test_createLocalVariable_read_typeAssignment() {
|
| + _indexTestUnit('''
|
| +main() {
|
| + int a = test;
|
| +}
|
| +''');
|
| + assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
|
| +main() {
|
| + int test;
|
| + int a = test;
|
| +}
|
| +''');
|
| + }
|
| +
|
| + void test_createLocalVariable_read_typeCondition() {
|
| + _indexTestUnit('''
|
| +main() {
|
| + if (!test) {
|
| + print(42);
|
| + }
|
| +}
|
| +''');
|
| + assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
|
| +main() {
|
| + bool test;
|
| + if (!test) {
|
| + print(42);
|
| + }
|
| +}
|
| +''');
|
| + }
|
| +
|
| + void test_createLocalVariable_read_typeInvocationArgument() {
|
| + _indexTestUnit('''
|
| +main() {
|
| + f(test);
|
| +}
|
| +f(String p) {}
|
| +''');
|
| + assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
|
| +main() {
|
| + String test;
|
| + f(test);
|
| +}
|
| +f(String p) {}
|
| +''');
|
| + }
|
| +
|
| + void test_createLocalVariable_write_assignment() {
|
| + _indexTestUnit('''
|
| +main() {
|
| + test = 42;
|
| +}
|
| +''');
|
| + assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
|
| +main() {
|
| + var test = 42;
|
| +}
|
| +''');
|
| + }
|
| +
|
| + void test_createLocalVariable_write_assignment_compound() {
|
| + _indexTestUnit('''
|
| +main() {
|
| + test += 42;
|
| +}
|
| +''');
|
| + assertHasFix(FixKind.CREATE_LOCAL_VARIABLE, '''
|
| +main() {
|
| + int test;
|
| + test += 42;
|
| +}
|
| +''');
|
| + }
|
| +
|
| void test_createMissingOverrides_functionType() {
|
| _indexTestUnit('''
|
| abstract class A {
|
|
|