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

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

Issue 2212093002: Fix for adding new elements into library cycles. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/dart/element/element.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | 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 f5b695f5b5c4128002d38fb3e84f5cf7bbddbd46..988db569fa3a0375ee004bc23552fba47fed4ad6 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -487,6 +487,43 @@ class B {}
expect(context.getErrors(a).errors, hasLength(0));
}
+ void test_applyChanges_addNewImport_invalidateLibraryCycle() {
+ context.analysisOptions =
+ new AnalysisOptionsImpl.from(context.analysisOptions)
+ ..strongMode = true;
+ Source embedder = addSource(
+ '/a.dart',
+ r'''
+library a;
+import 'b.dart';
+//import 'c.dart';
+''');
+ addSource(
+ '/b.dart',
+ r'''
+library b;
+import 'a.dart';
+''');
+ addSource(
+ '/c.dart',
+ r'''
+library c;
+import 'b.dart';
+''');
+ _performPendingAnalysisTasks();
+ // Add a new import into a.dart, this should invalidate its library cycle.
+ // If it doesn't, we will get a task cycle exception.
+ context.setContents(
+ embedder,
+ r'''
+library a;
+import 'b.dart';
+import 'c.dart';
+''');
+ _performPendingAnalysisTasks();
+ expect(context.getCacheEntry(embedder).exception, isNull);
+ }
+
void test_cacheConsistencyValidator_computed_deleted() {
CacheConsistencyValidator validator = context.cacheConsistencyValidator;
var stat = PerformanceStatistics.cacheConsistencyValidationStatistics;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698