Chromium Code Reviews| Index: pkg/analyzer/test/src/summary/resynthesize_test.dart |
| diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| index 3f6d6536ee097af4b7f4f35e66965121933a6fac..730ce28534af703cc5189f472bdf84f62847ea4b 100644 |
| --- a/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| +++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| @@ -865,6 +865,10 @@ class ResynthTest extends ResolverTestCase { |
| VariableElement resynthesized, VariableElement original, String desc) { |
| compareElements(resynthesized, original, desc); |
| compareTypes(resynthesized.type, original.type, desc); |
| + if (original is! Member) { |
|
Paul Berry
2016/02/17 21:15:30
Again, why should we skip this code if original is
scheglov
2016/02/17 21:27:51
I've added the explanation comment.
|
| + compareVariableInitializers( |
| + resynthesized.initializer, original.initializer, desc); |
| + } |
| VariableElementImpl originalActual = getActualElement(original, desc); |
| if (originalActual is ConstVariableElement) { |
| VariableElementImpl resynthesizedActual = |
| @@ -881,6 +885,18 @@ class ResynthTest extends ResolverTestCase { |
| checkPossibleLocalElements(resynthesized, original); |
| } |
| + void compareVariableInitializers( |
| + FunctionElement resynthesized, FunctionElement original, String desc) { |
| + if (original == null && resynthesized == null) { |
| + return; |
| + } |
| + expect(resynthesized, isNotNull, reason: desc); |
| + expect(resynthesized.nameOffset, original.nameOffset, reason: desc); |
| + expect(resynthesized.name, original.name, reason: desc); |
| + // TODO(scheglov) replace this method with compareFunctionElements() |
| + // once we resynthesize initializers return types. |
| + } |
| + |
| /** |
| * Serialize the given [library] into a summary. Then create a |
| * [_TestSummaryResynthesizer] which can deserialize it, along with any |