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

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

Issue 779333002: Always build elements, then match and restore if matches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 14e783bddd12893d1c188c6831ec1733682d2dc9..2a5eef218ebb773de608a3509319b96f9cef3258 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -1826,7 +1826,15 @@ class B extends Object with A {}
Source source = addSource(oldContent);
LibraryElement library = resolve(source);
CompilationUnit oldUnit = resolveCompilationUnit(source, library);
+ // parse
CompilationUnit newUnit = ParserTestCase.parseCompilationUnit(newContent);
+ // build elements
+ {
+ ElementHolder holder = new ElementHolder();
+ ElementBuilder builder = new ElementBuilder(holder);
+ newUnit.accept(builder);
+ }
+ // match
DeclarationMatcher matcher = new DeclarationMatcher();
expect(matcher.matches(newUnit, oldUnit.element), expectMatch);
}
@@ -1880,6 +1888,28 @@ class A {
_resolve(_editString('+', '*'), _isExpression);
}
+ void test_constructor_label_add() {
+ _resolveUnit(r'''
+class A {
+ A() {
+ return 42;
+ }
+}
+''');
+ _resolve(_editString('return', 'label: return'), _isBlock);
+ }
+
+ void test_constructor_localVariable_add() {
+ _resolveUnit(r'''
+class A {
+ A() {
+ 42;
+ }
+}
+''');
+ _resolve(_editString('42;', 'var res = 42;'), _isBlock);
+ }
+
void test_constructor_superConstructorInvocation() {
_resolveUnit(r'''
class A {
@@ -3933,6 +3963,8 @@ class _SameResolutionValidator implements AstVisitor {
void _verifyElement(Element a, Element b) {
if (a != b) {
+ print(a.location);
+ print(b.location);
fail('Expected: $b\n Actual: $a');
}
if (a == null && b == null) {
« 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