| 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 e01bf040e2563b5369bd7b1a0fd24a7d4b605bb0..dfb6a600fb09ed2d681c8cf48852012b60ded840 100644
|
| --- a/pkg/analysis_server/test/services/correction/fix_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| @@ -3782,6 +3782,32 @@ main() {
|
| ''');
|
| }
|
|
|
| + test_undefinedFunction_create_duplicateArgumentNames() async {
|
| + resolveTestUnit('''
|
| +class C {
|
| + int x;
|
| +}
|
| +
|
| +foo(C c1, C c2) {
|
| + bar(c1.x, c2.x);
|
| +}
|
| +''');
|
| + await assertHasFix(
|
| + DartFixKind.CREATE_FUNCTION,
|
| + '''
|
| +class C {
|
| + int x;
|
| +}
|
| +
|
| +foo(C c1, C c2) {
|
| + bar(c1.x, c2.x);
|
| +}
|
| +
|
| +void bar(int x, int x2) {
|
| +}
|
| +''');
|
| + }
|
| +
|
| test_undefinedFunction_create_dynamicArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| @@ -4433,6 +4459,34 @@ main() {
|
| await assertNoFix(DartFixKind.CREATE_METHOD);
|
| }
|
|
|
| + test_undefinedMethod_createUnqualified_duplicateArgumentNames() async {
|
| + resolveTestUnit('''
|
| +class C {
|
| + int x;
|
| +}
|
| +
|
| +class D {
|
| + foo(C c1, C c2) {
|
| + bar(c1.x, c2.x);
|
| + }
|
| +}''');
|
| + await assertHasFix(
|
| + DartFixKind.CREATE_METHOD,
|
| + '''
|
| +class C {
|
| + int x;
|
| +}
|
| +
|
| +class D {
|
| + foo(C c1, C c2) {
|
| + bar(c1.x, c2.x);
|
| + }
|
| +
|
| + void bar(int x, int x2) {
|
| + }
|
| +}''');
|
| + }
|
| +
|
| test_undefinedMethod_createUnqualified_parameters() async {
|
| resolveTestUnit('''
|
| class A {
|
|
|