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

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

Issue 2204623004: Don't report DeltaResult.KEEP_CONTINUE results as invalidated. (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/context/cache.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/cache_test.dart
diff --git a/pkg/analyzer/test/src/context/cache_test.dart b/pkg/analyzer/test/src/context/cache_test.dart
index ab35ffbc1438bab728489a890e207b64b675bd1b..dc09c80707c326ac76c60c6e493bffd20c86dbaf 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -701,6 +701,12 @@ class CacheEntryTest extends AbstractCacheTest {
unorderedEquals([new TargetedResult(target, result2)]));
expect(entry.getResultData(result2).dependedOnResults,
unorderedEquals([new TargetedResult(target, result1)]));
+ // record invalidated results
+ Set<TargetedResult> reportedInvalidatedResults = new Set<TargetedResult>();
+ cache.onResultInvalidated.listen((InvalidatedResult invalidatedResult) {
+ reportedInvalidatedResults.add(new TargetedResult(
+ invalidatedResult.entry.target, invalidatedResult.descriptor));
+ });
// invalidate result2 with Delta: keep result2, invalidate result3
entry.setState(result2, CacheState.INVALID,
delta: new _KeepContinueDelta(target, result2));
@@ -712,6 +718,10 @@ class CacheEntryTest extends AbstractCacheTest {
unorderedEquals([new TargetedResult(target, result2)]));
expect(entry.getResultData(result2).dependedOnResults,
unorderedEquals([new TargetedResult(target, result1)]));
+ // (target, result3) was reported as invalidated
+ // (target, result2) was NOT reported
+ expect(reportedInvalidatedResults,
+ unorderedEquals([new TargetedResult(target, result3)]));
}
test_setState_valid() {
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698