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

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

Issue 755743002: Incremental improvements in parameters and types matching. (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
« 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 9bce2b0b625a467ad2d7f91fe3ac7cd2cfa2b4bf..8bd58df97e67d70f487ad9025d726eeaeaf986fa 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -266,6 +266,20 @@ class A {
''');
}
+ void test_false_defaultFieldFormalParameterElement_wasSimple() {
+ _assertCompilationUnitMatches(false, r'''
+class A {
+ int field;
+ A(int field);
+}
+''', r'''
+class A {
+ int field;
+ A([this.field = 0]);
+}
+''');
+ }
+
void test_false_enum_constants_add() {
resetWithEnum();
_assertCompilationUnitMatches(false, r'''
@@ -480,6 +494,20 @@ class T {
''');
}
+ void test_false_fieldFormalParameterElement_wasSimple() {
+ _assertCompilationUnitMatches(false, r'''
+class A {
+ int field;
+ A(int field);
+}
+''', r'''
+class A {
+ int field;
+ A(this.field);
+}
+''');
+ }
+
void test_false_final_type_different() {
_assertCompilationUnitMatches(false, r'''
class T {
@@ -1024,6 +1052,20 @@ class A {
''');
}
+ void test_true_defaultFieldFormalParameterElement() {
+ _assertCompilationUnitMatches(true, r'''
+class A {
+ int field;
+ A([this.field = 0]);
+}
+''', r'''
+class A {
+ int field;
+ A([this.field = 0]);
+}
+''');
+ }
+
void test_true_enum_constants_reorder() {
resetWithEnum();
_assertCompilationUnitMatches(true, r'''
@@ -1161,6 +1203,20 @@ class T {
''');
}
+ void test_true_fieldFormalParameterElement() {
+ _assertCompilationUnitMatches(true, r'''
+class A {
+ int field;
+ A(this.field);
+}
+''', r'''
+class A {
+ int field;
+ A(this.field);
+}
+''');
+ }
+
void test_true_implementsClause_same() {
_assertCompilationUnitMatches(true, r'''
class A {}
@@ -1391,6 +1447,34 @@ Map<int, String> A;
''');
}
+ void test_true_type_dynamic() {
+ _assertCompilationUnitMatches(true, r'''
+dynamic a() {}
+''', r'''
+dynamic a() {}
+''');
+ }
+
+ void test_true_type_noTypeArguments_implyAllDynamic() {
Brian Wilkerson 2014/11/24 21:06:41 Perhaps test some false cases for types, such as
scheglov 2014/11/24 21:12:03 Thank you. Added.
+ _assertCompilationUnitMatches(true, r'''
+class A<T> {}
+A main() {
+}
+''', r'''
+class A<T> {}
+A main() {
+}
+''');
+ }
+
+ void test_true_type_void() {
+ _assertCompilationUnitMatches(true, r'''
+void a() {}
+''', r'''
+void a() {}
+''');
+ }
+
void test_true_withClause_same() {
_assertCompilationUnitMatches(true, r'''
class A {}
@@ -1882,6 +1966,13 @@ main() {
}
}
+ static void _assertEqualsToken(Token incrToken, Token fullToken) {
+ expect(incrToken.type, fullToken.type);
+ expect(incrToken.offset, fullToken.offset);
+ expect(incrToken.length, fullToken.length);
+ expect(incrToken.lexeme, fullToken.lexeme);
+ }
+
static void _assertEqualsTokens(CompilationUnit incrUnit,
CompilationUnit fullUnit) {
Token incrToken = incrUnit.beginToken;
@@ -1894,13 +1985,6 @@ main() {
fullToken = fullToken.next;
}
}
-
- static void _assertEqualsToken(Token incrToken, Token fullToken) {
- expect(incrToken.type, fullToken.type);
- expect(incrToken.offset, fullToken.offset);
- expect(incrToken.length, fullToken.length);
- expect(incrToken.lexeme, fullToken.lexeme);
- }
}
« 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