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

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

Issue 924783005: Improve code generation for 'bottom' and 'dynamic' arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 9e33386efc5f7405bc9a2f13ba4bc4b408374f2a..efb85c3225e77554f062065f1ad16dc581fcacb7 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -2182,6 +2182,40 @@ main() {
''');
}
+ void test_undefinedFunction_create_dynamicArgument() {
+ _indexTestUnit('''
+main() {
+ dynamic v;
+ test(v);
+}
+''');
+ assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+ dynamic v;
+ test(v);
+}
+
+void test(v) {
+}
+''');
+ }
+
+ void test_undefinedFunction_create_dynamicReturnType() {
+ _indexTestUnit('''
+main() {
+ dynamic v = test();
+}
+''');
+ assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+ dynamic v = test();
+}
+
+test() {
+}
+''');
+ }
+
void test_undefinedFunction_create_fromFunction() {
_indexTestUnit('''
main() {
@@ -2262,6 +2296,22 @@ void process(List<int> items) {
''');
}
+ void test_undefinedFunction_create_nullArgument() {
+ _indexTestUnit('''
+main() {
+ test(null);
+}
+''');
+ assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+ test(null);
+}
+
+void test(arg0) {
+}
+''');
+ }
+
void test_undefinedFunction_create_returnType_bool_expressions() {
assert_undefinedFunction_create_returnType_bool("!test();");
assert_undefinedFunction_create_returnType_bool("b && test();");
« 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