| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/constant/value.dart'; | 10 import 'package:analyzer/dart/constant/value.dart'; |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 originalParameters[i], | 909 originalParameters[i], |
| 910 '$desc parameter ${originalParameters[i].name}'); | 910 '$desc parameter ${originalParameters[i].name}'); |
| 911 } | 911 } |
| 912 } | 912 } |
| 913 | 913 |
| 914 void compareParameterElements( | 914 void compareParameterElements( |
| 915 ParameterElement resynthesized, ParameterElement original, String desc) { | 915 ParameterElement resynthesized, ParameterElement original, String desc) { |
| 916 compareVariableElements(resynthesized, original, desc); | 916 compareVariableElements(resynthesized, original, desc); |
| 917 compareParameterElementLists( | 917 compareParameterElementLists( |
| 918 resynthesized.parameters, original.parameters, desc); | 918 resynthesized.parameters, original.parameters, desc); |
| 919 expect(resynthesized.parameterKind, original.parameterKind); | 919 expect(resynthesized.parameterKind, original.parameterKind, reason: desc); |
| 920 expect(resynthesized.isInitializingFormal, original.isInitializingFormal, | 920 expect(resynthesized.isInitializingFormal, original.isInitializingFormal, |
| 921 reason: desc); | 921 reason: desc); |
| 922 expect(resynthesized is FieldFormalParameterElementImpl, | 922 expect(resynthesized is FieldFormalParameterElementImpl, |
| 923 original is FieldFormalParameterElementImpl); | 923 original is FieldFormalParameterElementImpl); |
| 924 if (resynthesized is FieldFormalParameterElementImpl && | 924 if (resynthesized is FieldFormalParameterElementImpl && |
| 925 original is FieldFormalParameterElementImpl) { | 925 original is FieldFormalParameterElementImpl) { |
| 926 if (original.field == null) { | 926 if (original.field == null) { |
| 927 expect(resynthesized.field, isNull, reason: '$desc field'); | 927 expect(resynthesized.field, isNull, reason: '$desc field'); |
| 928 } else { | 928 } else { |
| 929 expect(resynthesized.field, isNotNull, reason: '$desc field'); | 929 expect(resynthesized.field, isNotNull, reason: '$desc field'); |
| (...skipping 3682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4612 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4612 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4613 } | 4613 } |
| 4614 return serializedUnit; | 4614 return serializedUnit; |
| 4615 } | 4615 } |
| 4616 | 4616 |
| 4617 @override | 4617 @override |
| 4618 bool hasLibrarySummary(String uri) { | 4618 bool hasLibrarySummary(String uri) { |
| 4619 return true; | 4619 return true; |
| 4620 } | 4620 } |
| 4621 } | 4621 } |
| OLD | NEW |