| 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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 fail('Type mismatch: expected ${original.runtimeType},' | 1075 fail('Type mismatch: expected ${original.runtimeType},' |
| 1076 ' got ${resynthesized.runtimeType} ($desc)'); | 1076 ' got ${resynthesized.runtimeType} ($desc)'); |
| 1077 } else { | 1077 } else { |
| 1078 fail('Unimplemented comparison for ${original.runtimeType}'); | 1078 fail('Unimplemented comparison for ${original.runtimeType}'); |
| 1079 } | 1079 } |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 void compareUriReferencedElements(UriReferencedElementImpl resynthesized, | 1082 void compareUriReferencedElements(UriReferencedElementImpl resynthesized, |
| 1083 UriReferencedElementImpl original, String desc) { | 1083 UriReferencedElementImpl original, String desc) { |
| 1084 compareElements(resynthesized, original, desc); | 1084 compareElements(resynthesized, original, desc); |
| 1085 expect(resynthesized.uri, original.uri); | 1085 expect(resynthesized.uri, original.uri, reason: '$desc uri'); |
| 1086 expect(resynthesized.uriOffset, original.uriOffset, reason: desc); | 1086 expect(resynthesized.uriOffset, original.uriOffset, |
| 1087 expect(resynthesized.uriEnd, original.uriEnd, reason: desc); | 1087 reason: '$desc uri uriOffset'); |
| 1088 expect(resynthesized.uriEnd, original.uriEnd, reason: '$desc uriEnd'); |
| 1088 } | 1089 } |
| 1089 | 1090 |
| 1090 void compareVariableElements( | 1091 void compareVariableElements( |
| 1091 VariableElement resynthesized, VariableElement original, String desc) { | 1092 VariableElement resynthesized, VariableElement original, String desc) { |
| 1092 compareElements(resynthesized, original, desc); | 1093 compareElements(resynthesized, original, desc); |
| 1093 compareTypes(resynthesized.type, original.type, desc); | 1094 compareTypes(resynthesized.type, original.type, desc); |
| 1094 VariableElementImpl resynthesizedActual = | 1095 VariableElementImpl resynthesizedActual = |
| 1095 getActualElement(resynthesized, desc); | 1096 getActualElement(resynthesized, desc); |
| 1096 VariableElementImpl originalActual = getActualElement(original, desc); | 1097 VariableElementImpl originalActual = getActualElement(original, desc); |
| 1097 if (!skipBrokenAstInference) { | 1098 if (!skipBrokenAstInference) { |
| (...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4598 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4599 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4599 } | 4600 } |
| 4600 return serializedUnit; | 4601 return serializedUnit; |
| 4601 } | 4602 } |
| 4602 | 4603 |
| 4603 @override | 4604 @override |
| 4604 bool hasLibrarySummary(String uri) { | 4605 bool hasLibrarySummary(String uri) { |
| 4605 return true; | 4606 return true; |
| 4606 } | 4607 } |
| 4607 } | 4608 } |
| OLD | NEW |