Skip to content

Commit

Permalink
Add a test for bulk application of the remove_argument fix
Browse files Browse the repository at this point in the history
Change-Id: I0cf9272d1e38adf6ef46965aef0b6f8c3bd9d558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217287
Reviewed-by: Phil Quitslund <[email protected]>
Commit-Queue: Brian Wilkerson <[email protected]>
  • Loading branch information
bwilkerson authored and [email protected] committed Oct 19, 2021
1 parent 8462f1d commit a18e51f
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RemoveArgumentBulkTest extends BulkFixProcessorTest {
@override
String get lintCode => LintNames.avoid_redundant_argument_values;

Future<void> test_singleFile() async {
Future<void> test_independentInvocations() async {
await resolveTestCode('''
void f({bool valWithDefault = true, bool val}) {}
void f2({bool valWithDefault = true, bool val}) {}
Expand All @@ -39,6 +39,23 @@ void main() {
f();
f2(val: false);
}
''');
}

Future<void> test_multipleInSingleInvocation() async {
await resolveTestCode('''
void f() {
g(a: 0, b: 1, c: 2);
}
void g({int a = 0, int b = 1, int c = 2}) {}
''');
await assertHasFix('''
void f() {
g();
}
void g({int a = 0, int b = 1, int c = 2}) {}
''');
}
}
Expand Down

0 comments on commit a18e51f

Please sign in to comment.