| 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/src/generated/element.dart'; | 7 import 'package:analyzer/src/generated/element.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart'; | 8 import 'package:analyzer/src/generated/engine.dart'; |
| 9 import 'package:analyzer/src/generated/resolver.dart' show Namespace; | 9 import 'package:analyzer/src/generated/resolver.dart' show Namespace; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 expect(resynthesized.entryPoint, isNull); | 71 expect(resynthesized.entryPoint, isNull); |
| 72 } else { | 72 } else { |
| 73 expect(resynthesized.entryPoint, isNotNull); | 73 expect(resynthesized.entryPoint, isNotNull); |
| 74 compareFunctionElements( | 74 compareFunctionElements( |
| 75 resynthesized.entryPoint, original.entryPoint, '(entry point)'); | 75 resynthesized.entryPoint, original.entryPoint, '(entry point)'); |
| 76 } | 76 } |
| 77 compareNamespaces(resynthesized.publicNamespace, original.publicNamespace, | 77 compareNamespaces(resynthesized.publicNamespace, original.publicNamespace, |
| 78 '(public namespace)'); | 78 '(public namespace)'); |
| 79 compareNamespaces(resynthesized.exportNamespace, original.exportNamespace, | 79 compareNamespaces(resynthesized.exportNamespace, original.exportNamespace, |
| 80 '(export namespace)'); | 80 '(export namespace)'); |
| 81 compareExecutableElements( |
| 82 resynthesized.loadLibraryFunction as ExecutableElementImpl, |
| 83 original.loadLibraryFunction as ExecutableElementImpl, |
| 84 '(loadLibraryFunction)'); |
| 81 // TODO(paulberry): test metadata. | 85 // TODO(paulberry): test metadata. |
| 82 } | 86 } |
| 83 | 87 |
| 84 void compareClassElements( | 88 void compareClassElements( |
| 85 ClassElementImpl resynthesized, ClassElementImpl original, String desc) { | 89 ClassElementImpl resynthesized, ClassElementImpl original, String desc) { |
| 86 compareElements(resynthesized, original, desc); | 90 compareElements(resynthesized, original, desc); |
| 87 expect(resynthesized.fields.length, original.fields.length, | 91 expect(resynthesized.fields.length, original.fields.length, |
| 88 reason: '$desc fields.length'); | 92 reason: '$desc fields.length'); |
| 89 for (int i = 0; i < resynthesized.fields.length; i++) { | 93 for (int i = 0; i < resynthesized.fields.length; i++) { |
| 90 String name = original.fields[i].name; | 94 String name = original.fields[i].name; |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 test_variable_setterInPart_getterInPart() { | 1482 test_variable_setterInPart_getterInPart() { |
| 1479 addNamedSource('/a.dart', 'part of my.lib; void set x(int _) {}'); | 1483 addNamedSource('/a.dart', 'part of my.lib; void set x(int _) {}'); |
| 1480 addNamedSource('/b.dart', 'part of my.lib; int get x => 42;'); | 1484 addNamedSource('/b.dart', 'part of my.lib; int get x => 42;'); |
| 1481 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); | 1485 checkLibrary('library my.lib; part "a.dart"; part "b.dart";'); |
| 1482 } | 1486 } |
| 1483 | 1487 |
| 1484 test_variables() { | 1488 test_variables() { |
| 1485 checkLibrary('int i; int j;'); | 1489 checkLibrary('int i; int j;'); |
| 1486 } | 1490 } |
| 1487 } | 1491 } |
| OLD | NEW |