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/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 // TODO(scheglov) prefixes cannot be resynthesized | 612 // TODO(scheglov) prefixes cannot be resynthesized |
613 return; | 613 return; |
614 } | 614 } |
615 expect(original, isNotNull); | 615 expect(original, isNotNull); |
616 expect(resynthesized, isNotNull); | 616 expect(resynthesized, isNotNull); |
617 expect(rImpl.runtimeType, oImpl.runtimeType); | 617 expect(rImpl.runtimeType, oImpl.runtimeType); |
618 expect(resynthesized.kind, original.kind); | 618 expect(resynthesized.kind, original.kind); |
619 expect(resynthesized.location, original.location, reason: desc); | 619 expect(resynthesized.location, original.location, reason: desc); |
620 expect(resynthesized.name, original.name); | 620 expect(resynthesized.name, original.name); |
621 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); | 621 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); |
| 622 expect(rImpl.codeOffset, oImpl.codeOffset, reason: desc); |
| 623 expect(rImpl.codeLength, oImpl.codeLength, reason: desc); |
622 expect(resynthesized.documentationComment, original.documentationComment, | 624 expect(resynthesized.documentationComment, original.documentationComment, |
623 reason: desc); | 625 reason: desc); |
624 expect(resynthesized.docRange, original.docRange, reason: desc); | 626 expect(resynthesized.docRange, original.docRange, reason: desc); |
625 compareMetadata(resynthesized.metadata, original.metadata, desc); | 627 compareMetadata(resynthesized.metadata, original.metadata, desc); |
626 // Modifiers are a pain to test via handles. So just test them via the | 628 // Modifiers are a pain to test via handles. So just test them via the |
627 // actual element. | 629 // actual element. |
628 for (Modifier modifier in Modifier.persistedValues) { | 630 for (Modifier modifier in Modifier.persistedValues) { |
629 bool got = rImpl.hasModifier(modifier); | 631 bool got = rImpl.hasModifier(modifier); |
630 bool want = oImpl.hasModifier(modifier); | 632 bool want = oImpl.hasModifier(modifier); |
631 expect(got, want, | 633 expect(got, want, |
(...skipping 3477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4109 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4111 fail('Unexpectedly tried to get unlinked summary for $uri'); |
4110 } | 4112 } |
4111 return serializedUnit; | 4113 return serializedUnit; |
4112 } | 4114 } |
4113 | 4115 |
4114 @override | 4116 @override |
4115 bool hasLibrarySummary(String uri) { | 4117 bool hasLibrarySummary(String uri) { |
4116 return true; | 4118 return true; |
4117 } | 4119 } |
4118 } | 4120 } |
OLD | NEW |