Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 2002163002: Resynthesize exports lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 void checkLibraryElements( 104 void checkLibraryElements(
105 LibraryElementImpl original, LibraryElementImpl resynthesized) { 105 LibraryElementImpl original, LibraryElementImpl resynthesized) {
106 compareElements(resynthesized, original, '(library)'); 106 compareElements(resynthesized, original, '(library)');
107 expect(resynthesized.displayName, original.displayName); 107 expect(resynthesized.displayName, original.displayName);
108 expect(original.enclosingElement, isNull); 108 expect(original.enclosingElement, isNull);
109 expect(resynthesized.enclosingElement, isNull); 109 expect(resynthesized.enclosingElement, isNull);
110 expect(resynthesized.hasExtUri, original.hasExtUri); 110 expect(resynthesized.hasExtUri, original.hasExtUri);
111 compareCompilationUnitElements(resynthesized.definingCompilationUnit, 111 compareCompilationUnitElements(resynthesized.definingCompilationUnit,
112 original.definingCompilationUnit); 112 original.definingCompilationUnit);
113 expect(resynthesized.parts.length, original.parts.length); 113 expect(resynthesized.parts.length, original.parts.length, reason: 'parts');
114 for (int i = 0; i < resynthesized.parts.length; i++) { 114 for (int i = 0; i < resynthesized.parts.length; i++) {
115 compareCompilationUnitElements(resynthesized.parts[i], original.parts[i]); 115 compareCompilationUnitElements(resynthesized.parts[i], original.parts[i]);
116 } 116 }
117 expect(resynthesized.imports.length, original.imports.length); 117 expect(resynthesized.imports.length, original.imports.length,
118 reason: 'imports');
118 for (int i = 0; i < resynthesized.imports.length; i++) { 119 for (int i = 0; i < resynthesized.imports.length; i++) {
119 compareImportElements(resynthesized.imports[i], original.imports[i], 120 compareImportElements(resynthesized.imports[i], original.imports[i],
120 'import ${original.imports[i].uri}'); 121 'import ${original.imports[i].uri}');
121 } 122 }
122 expect(resynthesized.exports.length, original.exports.length); 123 expect(resynthesized.exports.length, original.exports.length,
124 reason: 'exports');
123 for (int i = 0; i < resynthesized.exports.length; i++) { 125 for (int i = 0; i < resynthesized.exports.length; i++) {
124 compareExportElements(resynthesized.exports[i], original.exports[i], 126 compareExportElements(resynthesized.exports[i], original.exports[i],
125 'export ${original.exports[i].uri}'); 127 'export ${original.exports[i].uri}');
126 } 128 }
127 expect(resynthesized.nameLength, original.nameLength); 129 expect(resynthesized.nameLength, original.nameLength);
128 compareNamespaces(resynthesized.publicNamespace, original.publicNamespace, 130 compareNamespaces(resynthesized.publicNamespace, original.publicNamespace,
129 '(public namespace)'); 131 '(public namespace)');
130 compareNamespaces(resynthesized.exportNamespace, original.exportNamespace, 132 compareNamespaces(resynthesized.exportNamespace, original.exportNamespace,
131 '(export namespace)'); 133 '(export namespace)');
132 if (original.entryPoint == null) { 134 if (original.entryPoint == null) {
(...skipping 4471 matching lines...) Expand 10 before | Expand all | Expand 10 after
4604 fail('Unexpectedly tried to get unlinked summary for $uri'); 4606 fail('Unexpectedly tried to get unlinked summary for $uri');
4605 } 4607 }
4606 return serializedUnit; 4608 return serializedUnit;
4607 } 4609 }
4608 4610
4609 @override 4611 @override
4610 bool hasLibrarySummary(String uri) { 4612 bool hasLibrarySummary(String uri) {
4611 return true; 4613 return true;
4612 } 4614 }
4613 } 4615 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698