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

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

Issue 733203004: Matching fields, some parameters, ignore locals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
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 5100f5f3166766a4f41b488ed46d7d5c82724c28..c748bc0da7e40f89c64758413c40d9d8fee707d2 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -164,6 +164,132 @@ class B {}
''');
}
+ void test_false_field_list_add() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ int A = 1;
+ int C = 3;
+}
+''', r'''
+class T {
+ int A = 1;
+ int B = 2;
+ int C = 3;
+}
+''');
+ }
+
+ void test_false_field_list_remove() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ int A = 1;
+ int B = 2;
+ int C = 3;
+}
+''', r'''
+class T {
+ int A = 1;
+ int C = 3;
+}
+''');
+ }
+
+ void test_false_field_modifier_isConst() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ static final A = 1;
+}
+''', r'''
+class T {
+ static const A = 1;
+}
+''');
+ }
+
+ void test_false_field_modifier_isFinal() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ int A = 1;
+}
+''', r'''
+class T {
+ final int A = 1;
+}
+''');
+ }
+
+ void test_false_field_modifier_isStatic() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ int A = 1;
+}
+''', r'''
+class T {
+ static int A = 1;
+}
+''');
+ }
+
+ void test_false_field_modifier_wasConst() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ static const A = 1;
+}
+''', r'''
+class T {
+ static final A = 1;
+}
+''');
+ }
+
+ void test_false_field_modifier_wasFinal() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ final int A = 1;
+}
+''', r'''
+class T {
+ int A = 1;
+}
+''');
+ }
+
+ void test_false_field_modifier_wasStatic() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ static int A = 1;
+}
+''', r'''
+class T {
+ int A = 1;
+}
+''');
+ }
+
+ void test_false_field_type_differentArgs() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ List<int> A;
+}
+''', r'''
+class T {
+ List<String> A;
+}
+''');
+ }
+
+ void test_false_final_type_different() {
+ _assertCompilationUnitMatches(false, r'''
+class T {
+ int A;
+}
+''', r'''
+class T {
+ String A;
+}
+''');
+ }
+
void test_false_implementsClause_add() {
_assertCompilationUnitMatches(false, r'''
class A {}
@@ -250,6 +376,14 @@ int A = 1;
''');
}
+ void test_false_topLevelVariable_synthetic_wasGetter() {
+ _assertCompilationUnitMatches(false, r'''
+int get A => 1;
+''', r'''
+final int A = 1;
+''');
+ }
+
void test_false_topLevelVariable_type_different() {
_assertCompilationUnitMatches(false, r'''
int A;
@@ -376,6 +510,30 @@ class A {
''');
}
+ void test_true_executable_same_hasLabel() {
+ _assertCompilationUnitMatches(true, r'''
+main() {
+ label: return 42;
+}
+''', r'''
+main() {
+ label: return 42;
+}
+''');
+ }
+
+ void test_true_executable_same_hasLocalVariable() {
+ _assertCompilationUnitMatches(true, r'''
+main() {
+ int a = 42;
+}
+''', r'''
+main() {
+ int a = 42;
+}
+''');
+ }
+
void test_true_extendsClause_same() {
_assertCompilationUnitMatches(true, r'''
class A {}
@@ -386,6 +544,38 @@ class B extends A {}
''');
}
+ void test_true_field_list_reorder() {
+ _assertCompilationUnitMatches(true, r'''
+class T {
+ int A = 1;
+ int B = 2;
+ int C = 3;
+}
+''', r'''
+class T {
+ int C = 3;
+ int A = 1;
+ int B = 2;
+}
+''');
+ }
+
+ void test_true_field_list_same() {
+ _assertCompilationUnitMatches(true, r'''
+class T {
+ int A = 1;
+ int B = 2;
+ int C = 3;
+}
+''', r'''
+class T {
+ int A = 1;
+ int B = 2;
+ int C = 3;
+}
+''');
+ }
+
void test_true_implementsClause_same() {
_assertCompilationUnitMatches(true, r'''
class A {}

Powered by Google App Engine
This is Rietveld 408576698