| 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 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/dart/element/element.dart'; | 9 import 'package:analyzer/src/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/dart/element/type.dart'; | 10 import 'package:analyzer/src/dart/element/type.dart'; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 expect(resynthesized.name, original.name); | 213 expect(resynthesized.name, original.name); |
| 214 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); | 214 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); |
| 215 expect(resynthesized.documentationComment, original.documentationComment, | 215 expect(resynthesized.documentationComment, original.documentationComment, |
| 216 reason: desc); | 216 reason: desc); |
| 217 expect(resynthesized.docRange, original.docRange, reason: desc); | 217 expect(resynthesized.docRange, original.docRange, reason: desc); |
| 218 // Modifiers are a pain to test via handles. So just test them via the | 218 // Modifiers are a pain to test via handles. So just test them via the |
| 219 // actual element. | 219 // actual element. |
| 220 ElementImpl actualResynthesized = getActualElement(resynthesized, desc); | 220 ElementImpl actualResynthesized = getActualElement(resynthesized, desc); |
| 221 ElementImpl actualOriginal = getActualElement(original, desc); | 221 ElementImpl actualOriginal = getActualElement(original, desc); |
| 222 for (Modifier modifier in Modifier.values) { | 222 for (Modifier modifier in Modifier.values) { |
| 223 if (modifier == Modifier.MIXIN) { | |
| 224 // Skipping for now. TODO(paulberry): fix. | |
| 225 continue; | |
| 226 } | |
| 227 bool got = actualResynthesized.hasModifier(modifier); | 223 bool got = actualResynthesized.hasModifier(modifier); |
| 228 bool want = actualOriginal.hasModifier(modifier); | 224 bool want = actualOriginal.hasModifier(modifier); |
| 229 expect(got, want, | 225 expect(got, want, |
| 230 reason: 'Mismatch in $desc.$modifier: got $got, want $want'); | 226 reason: 'Mismatch in $desc.$modifier: got $got, want $want'); |
| 231 } | 227 } |
| 232 } | 228 } |
| 233 | 229 |
| 234 void compareExecutableElements(ExecutableElement resynthesized, | 230 void compareExecutableElements(ExecutableElement resynthesized, |
| 235 ExecutableElement original, String desc) { | 231 ExecutableElement original, String desc) { |
| 236 compareElements(resynthesized, original, desc); | 232 compareElements(resynthesized, original, desc); |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 fail('Unexpectedly tried to get unlinked summary for $uri'); | 1731 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 1736 } | 1732 } |
| 1737 return serializedUnit; | 1733 return serializedUnit; |
| 1738 } | 1734 } |
| 1739 | 1735 |
| 1740 @override | 1736 @override |
| 1741 bool hasLibrarySummary(String uri) { | 1737 bool hasLibrarySummary(String uri) { |
| 1742 return true; | 1738 return true; |
| 1743 } | 1739 } |
| 1744 } | 1740 } |
| OLD | NEW |