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

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

Issue 2171673002: Fix for limited invalidation in the middle, and the unlimited invalidation for an exported library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update tasks. Created 4 years, 5 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') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('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 c8f6230675f8c10d07b4d0acdd15da0c022ef6f3..47b273c069b7609f82433f287b218e22b67e699b 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3630,6 +3630,55 @@ class A {
_assertValid(b, LIBRARY_ERRORS_READY);
}
+ void test_sequence_middleLimited_thenFirstFull() {
+ Source a = addSource(
+ '/a.dart',
+ r'''
+class A {}
+''');
+ Source b = addSource(
+ '/b.dart',
+ r'''
+export 'a.dart';
+''');
+ Source c = addSource(
+ '/c.dart',
+ r'''
+import 'b.dart';
+A a;
+''');
+ _performPendingAnalysisTasks();
+ // Update b.dart: limited invalidation.
+ // Results in c.dart are valid, because the change in b.dart does not
+ // affect anything in c.dart.
+ context.setContents(
+ b,
+ r'''
+export 'a.dart';
+class B {}
+''');
+ _assertValid(a, LIBRARY_ERRORS_READY);
+ _assertInvalid(b, LIBRARY_ERRORS_READY);
+ _assertValid(c, LIBRARY_ERRORS_READY);
+ _assertUnitValid(c, RESOLVED_UNIT4);
+ _assertUnitValid(c, RESOLVED_UNIT5);
+ // Update a.dart: unlimited invalidation.
+ // Results RESOLVED_UNIT4, RESOLVED_UNIT5, and RESOLVED_UNIT6 in c.dart
+ // are invalid, because after unlimited change to a.dart everything
+ // should be invalidated.
+ // This fixes the problem that c.dart was not re-resolving type names.
+ context.setContents(
+ a,
+ r'''
+import 'dart:async';
+class A {}
+''');
+ _assertInvalid(a, LIBRARY_ERRORS_READY);
+ _assertInvalid(b, LIBRARY_ERRORS_READY);
+ _assertInvalid(c, LIBRARY_ERRORS_READY);
+ _assertInvalidUnits(c, RESOLVED_UNIT4);
+ }
+
void test_sequence_noChange_thenChange() {
Source a = addSource(
'/a.dart',
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698