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

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

Issue 1475743003: Issue 24865. Quick Fix 'Create Method' should create named parameters. (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 6aacb6abedff41aac408b117fa8c281d9a6ad70d..72134291fc46b05df19c6a8bd569a98adb30ed31 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -4215,6 +4215,50 @@ class A {
_assertLinkedGroup(change.linkedEditGroups[index++], ['s)']);
}
+ test_undefinedMethod_createUnqualified_parameters_named() async {
+ resolveTestUnit('''
+class A {
+ main() {
+ myUndefinedMethod(0, bbb: 1.0, ccc: '2');
+ }
+}
+''');
+ await assertHasFix(
+ DartFixKind.CREATE_METHOD,
+ '''
+class A {
+ main() {
+ myUndefinedMethod(0, bbb: 1.0, ccc: '2');
+ }
+
+ void myUndefinedMethod(int i, {double bbb, String ccc}) {
+ }
+}
+''');
+ // linked positions
+ int index = 0;
+ _assertLinkedGroup(
+ change.linkedEditGroups[index++], ['void myUndefinedMethod(']);
+ _assertLinkedGroup(change.linkedEditGroups[index++],
+ ['myUndefinedMethod(0', 'myUndefinedMethod(int']);
+ _assertLinkedGroup(
+ change.linkedEditGroups[index++],
+ ['int i'],
+ expectedSuggestions(LinkedEditSuggestionKind.TYPE,
+ ['int', 'num', 'Object', 'Comparable']));
+ _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']);
+ _assertLinkedGroup(
+ change.linkedEditGroups[index++],
+ ['double bbb'],
+ expectedSuggestions(LinkedEditSuggestionKind.TYPE,
+ ['double', 'num', 'Object', 'Comparable']));
+ _assertLinkedGroup(
+ change.linkedEditGroups[index++],
+ ['String ccc'],
+ expectedSuggestions(
+ LinkedEditSuggestionKind.TYPE, ['String', 'Object', 'Comparable']));
+ }
+
test_undefinedMethod_createUnqualified_returnType() async {
resolveTestUnit('''
class 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