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

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

Issue 2172143003: Fix for recording dependency when the user is recorder before the provider. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/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 d3ac2417e5b795798fe01d989d206c859ad676f3..ab35ffbc1438bab728489a890e207b64b675bd1b 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -781,6 +781,28 @@ class CacheEntryTest extends AbstractCacheTest {
expect(entry.getValue(result2), 222);
}
+ test_setValue_userBeforeProvider_invalidateProvider_alsoUser() {
+ AnalysisTarget target1 = new TestSource('/a.dart');
+ AnalysisTarget target2 = new TestSource('/b.dart');
+ CacheEntry entry1 = new CacheEntry(target1);
+ CacheEntry entry2 = new CacheEntry(target2);
+ cache.put(entry1);
+ cache.put(entry2);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ // set results, all of them are VALID
+ entry2.setValue(result2, 222, [new TargetedResult(target1, result1)]);
+ entry1.setValue(result1, 111, TargetedResult.EMPTY_LIST);
+ expect(entry1.getState(result1), CacheState.VALID);
+ expect(entry2.getState(result2), CacheState.VALID);
+ expect(entry1.getValue(result1), 111);
+ expect(entry2.getValue(result2), 222);
+ // invalidate result1, should invalidate also result2
+ entry1.setState(result1, CacheState.INVALID);
+ expect(entry1.getState(result1), CacheState.INVALID);
+ expect(entry2.getState(result2), CacheState.INVALID);
+ }
+
test_setValueIncremental() {
AnalysisTarget target = new TestSource();
CacheEntry entry = new CacheEntry(target);
« 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