| 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 ElementImpl rImpl = getActualElement(resynthesized, desc); | 640 ElementImpl rImpl = getActualElement(resynthesized, desc); |
| 641 ElementImpl oImpl = getActualElement(original, desc); | 641 ElementImpl oImpl = getActualElement(original, desc); |
| 642 if (oImpl == null && rImpl == null) { | 642 if (oImpl == null && rImpl == null) { |
| 643 return; | 643 return; |
| 644 } | 644 } |
| 645 if (oImpl is PrefixElement) { | 645 if (oImpl is PrefixElement) { |
| 646 // TODO(scheglov) prefixes cannot be resynthesized | 646 // TODO(scheglov) prefixes cannot be resynthesized |
| 647 return; | 647 return; |
| 648 } | 648 } |
| 649 expect(original, isNotNull); | 649 expect(original, isNotNull); |
| 650 expect(resynthesized, isNotNull); | 650 expect(resynthesized, isNotNull, reason: desc); |
| 651 expect(rImpl.runtimeType, oImpl.runtimeType); | 651 expect(rImpl.runtimeType, oImpl.runtimeType); |
| 652 expect(resynthesized.kind, original.kind); | 652 expect(resynthesized.kind, original.kind); |
| 653 expect(resynthesized.location, original.location, reason: desc); | 653 expect(resynthesized.location, original.location, reason: desc); |
| 654 expect(resynthesized.name, original.name); | 654 expect(resynthesized.name, original.name); |
| 655 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); | 655 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); |
| 656 expect(rImpl.codeOffset, oImpl.codeOffset, reason: desc); | 656 expect(rImpl.codeOffset, oImpl.codeOffset, reason: desc); |
| 657 expect(rImpl.codeLength, oImpl.codeLength, reason: desc); | 657 expect(rImpl.codeLength, oImpl.codeLength, reason: desc); |
| 658 expect(resynthesized.documentationComment, original.documentationComment, | 658 expect(resynthesized.documentationComment, original.documentationComment, |
| 659 reason: desc); | 659 reason: desc); |
| 660 expect(resynthesized.docRange, original.docRange, reason: desc); | 660 expect(resynthesized.docRange, original.docRange, reason: desc); |
| (...skipping 3690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4351 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4351 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4352 } | 4352 } |
| 4353 return serializedUnit; | 4353 return serializedUnit; |
| 4354 } | 4354 } |
| 4355 | 4355 |
| 4356 @override | 4356 @override |
| 4357 bool hasLibrarySummary(String uri) { | 4357 bool hasLibrarySummary(String uri) { |
| 4358 return true; | 4358 return true; |
| 4359 } | 4359 } |
| 4360 } | 4360 } |
| OLD | NEW |