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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2092673002: Fix recomputing LibraryElement.exportNamespace. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index abbe02e8abf316f7fbd17ab11519d4cfcb501dd2..b102bc2d826baccce2e6bbef41cfd903f962dd8c 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -301,6 +301,39 @@ int b = aa;''';
expect(context.sourcesNeedingProcessing, hasLength(0));
}
+ void test_applyChanges_recompute_exportNamespace() {
+ Source libSource = addSource(
+ "/lib.dart",
+ r'''
+class A {}
+''');
+ Source exporterSource = addSource(
+ "/exporter.dart",
+ r'''
+export 'lib.dart';
+''');
+ _performPendingAnalysisTasks();
+ // initially: A
+ {
+ LibraryElement libraryElement =
+ context.getResult(exporterSource, LIBRARY_ELEMENT1) as LibraryElement;
+ expect(libraryElement.exportNamespace.definedNames.keys,
+ unorderedEquals(['A']));
+ }
+ // after update: B
+ context.setContents(
+ libSource,
+ r'''
+class B {}''');
+ _performPendingAnalysisTasks();
+ {
+ LibraryElement libraryElement =
+ context.getResult(exporterSource, LIBRARY_ELEMENT1) as LibraryElement;
+ expect(libraryElement.exportNamespace.definedNames.keys,
+ unorderedEquals(['B']));
+ }
+ }
+
Future test_applyChanges_remove() {
SourcesChangedListener listener = new SourcesChangedListener();
context.onSourcesChanged.listen(listener.onData);
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698