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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1468913004: Issue 25021. Fix for adding new required parameters when optional exist. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/fix_internal.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/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 3570b294d942b4dad4cad4de0760325c62ac0ad0..6aacb6abedff41aac408b117fa8c281d9a6ad70d 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -175,6 +175,16 @@ class Test {
''');
}
+ test_addMissingParameter_function_positional_hasNamed() async {
+ resolveTestUnit('''
+test({int a}) {}
+main() {
+ test(1);
+}
+''');
+ await assertNoFix(DartFixKind.ADD_MISSING_PARAMETER_POSITIONAL);
+ }
+
test_addMissingParameter_function_positional_hasZero() async {
resolveTestUnit('''
test() {}
@@ -192,6 +202,23 @@ main() {
''');
}
+ test_addMissingParameter_function_required_hasNamed() async {
+ resolveTestUnit('''
+test({int a}) {}
+main() {
+ test(1);
+}
+''');
+ await assertHasFix(
+ DartFixKind.ADD_MISSING_PARAMETER_REQUIRED,
+ '''
+test(int i, {int a}) {}
+main() {
+ test(1);
+}
+''');
+ }
+
test_addMissingParameter_function_required_hasOne() async {
resolveTestUnit('''
test(int a) {}
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698