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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_method_test.dart

Issue 672013002: Issue 21375. Fix for FunctionTypeAliasElement-based FunctionType source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/pubspec.yaml ('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/refactoring/extract_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index 8001fc0f8663b544520c404c13899e8dec4cd142..67e46cc94632280ac070e36e919593c7610bd0de 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -9,9 +9,9 @@ import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/refactoring/extract_method.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
-import '../../reflective_tests.dart';
import 'package:unittest/unittest.dart';
+import '../../reflective_tests.dart';
import 'abstract_refactoring.dart';
@@ -1323,6 +1323,25 @@ class A {
''');
}
+ test_singleExpression_parameter_functionTypeAlias() {
+ indexTestUnit('''
+typedef R Foo<S, R>(S s);
+void main(Foo<String, int> foo, String s) {
+ int a = foo(s);
+}
+''');
+ _createRefactoringForString('foo(s)');
+ // apply refactoring
+ return _assertSuccessfulRefactoring('''
+typedef R Foo<S, R>(S s);
+void main(Foo<String, int> foo, String s) {
+ int a = res(foo, s);
+}
+
+int res(Foo<String, int> foo, String s) => foo(s);
+''');
+ }
+
test_singleExpression_returnTypeGeneric() {
indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698