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

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

Issue 565023003: Issue 13029. Quick fix to create a function for a Function typed named parameter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months 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/util.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 b1a00cd2a150b713d281e6643c785b859d438344..086fe94ad247091188c195a2ded39944886157fc 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -727,6 +727,24 @@ int test(double a, String b) {
''');
}
+ void test_creationFunction_forFunctionType_coreFunction() {
+ _indexTestUnit('''
+main() {
+ useFunction(g: test);
+}
+useFunction({Function g}) {}
+''');
+ assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+ useFunction(g: test);
+}
+useFunction({Function g}) {}
+
+test() {
+}
+''');
+ }
+
void test_creationFunction_forFunctionType_dynamicArgument() {
_indexTestUnit('''
main() {
@@ -763,6 +781,24 @@ int test(double a, String b) {
''');
}
+ void test_creationFunction_forFunctionType_function_namedArgument() {
+ _indexTestUnit('''
+main() {
+ useFunction(g: test);
+}
+useFunction({int g(double a, String b)}) {}
+''');
+ assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+ useFunction(g: test);
+}
+useFunction({int g(double a, String b)}) {}
+
+int test(double a, String b) {
+}
+''');
+ }
+
void test_creationFunction_forFunctionType_method_enclosingClass_static() {
_indexTestUnit('''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698