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

Unified Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 995853002: Fix for matching field formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/incremental_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index 3eb51e3ef47934e9aa0b052887f9aa519f83cc89..3c57a9797c9ae1df153551a34d4a542e61c24a99 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -589,6 +589,118 @@ class T {
''');
}
+ void test_false_fieldFormalParameter_add() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(field);
+}
+''', r'''
+class A {
+ final field;
+ A(this.field);
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_add_function() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(field(a));
+}
+''', r'''
+class A {
+ final field;
+ A(this.field(a));
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_parameters_add() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(this.field(a));
+}
+''', r'''
+class A {
+ final field;
+ A(this.field(a, b));
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_parameters_remove() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(this.field(a, b));
+}
+''', r'''
+class A {
+ final field;
+ A(this.field(a));
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_parameters_typeEdit() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(this.field(int p));
+}
+''', r'''
+class A {
+ final field;
+ A(this.field(String p));
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_remove_default() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A([this.field = 0]);
+}
+''', r'''
+class A {
+ final field;
+ A([field = 0]);
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_remove_function() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(this.field(a));
+}
+''', r'''
+class A {
+ final field;
+ A(field(a));
+}
+''');
+ }
+
+ void test_false_fieldFormalParameter_remove_normal() {
+ _assertDoesNotMatch(r'''
+class A {
+ final field;
+ A(this.field);
+}
+''', r'''
+class A {
+ final field;
+ A(field);
+}
+''');
+ }
+
void test_false_fieldFormalParameterElement_wasSimple() {
_assertDoesNotMatch(r'''
class A {
@@ -1718,6 +1830,20 @@ class A {
''');
}
+ void test_true_fieldFormalParameter_function() {
+ _assertMatches(r'''
+class A {
+ final field;
+ A(this.field(int a, String b));
+}
+''', r'''
+class A {
+ final field;
+ A(this.field(int a, String b));
+}
+''');
+ }
+
void test_true_functionTypeAlias_list_reorder() {
_assertMatches(r'''
typedef A(int pa);
@@ -2843,6 +2969,23 @@ main() {
''');
}
+ void test_endOfLineComment_localFunction_inTopLevelVariable() {
+ _resolveUnit(r'''
+typedef int Binary(one, two, three);
+
+int Global = f((a, b, c) {
+ return 0; // Some comment
+});
+''');
+ _updateAndValidate(r'''
+typedef int Binary(one, two, three);
+
+int Global = f((a, b, c) {
+ return 0; // Some comment
+});
+''');
+ }
+
void test_endOfLineComment_outBody_add() {
_resolveUnit(r'''
main() {
@@ -2892,23 +3035,6 @@ main() {
''', expectedSuccess: false);
}
- void test_endOfLineComment_localFunction_inTopLevelVariable() {
- _resolveUnit(r'''
-typedef int Binary(one, two, three);
-
-int Global = f((a, b, c) {
- return 0; // Some comment
-});
-''');
- _updateAndValidate(r'''
-typedef int Binary(one, two, three);
-
-int Global = f((a, b, c) {
- return 0; // Some comment
-});
-''');
- }
-
void test_endOfLineComment_remove() {
_resolveUnit(r'''
main() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698