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

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

Issue 1144023009: Adapt the existing incremental resolution implementation to the new model. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes for review comments. Created 5 years, 7 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/test/generated/incremental_resolver_test.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 fd6ec2009d01664a2aed0260235d813bcd67f87d..80f81667fe1c49e700a729342fc85a75b6035a0e 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -624,6 +624,35 @@ class CacheEntryTest extends AbstractCacheTest {
expect(entry.getValue(result2), 222);
}
+ test_setValueIncremental() {
+ AnalysisTarget target = new TestSource();
+ CacheEntry entry = new CacheEntry(target);
+ cache.put(entry);
+ ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+ ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+ ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+ // set results, all of them are VALID
+ entry.setValue(result1, 111, TargetedResult.EMPTY_LIST);
+ entry.setValue(result2, 222, [new TargetedResult(target, result1)]);
+ entry.setValue(result3, 333, [new TargetedResult(target, result2)]);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.VALID);
+ expect(entry.getState(result3), CacheState.VALID);
+ expect(entry.getValue(result1), 111);
+ expect(entry.getValue(result2), 222);
+ expect(entry.getValue(result3), 333);
+ // replace result1, keep "dependedOn", invalidate result3
+ entry.setValueIncremental(result2, 2222);
+ expect(entry.getState(result1), CacheState.VALID);
+ expect(entry.getState(result2), CacheState.VALID);
+ expect(entry.getState(result3), CacheState.INVALID);
+ expect(entry.getValue(result1), 111);
+ expect(entry.getValue(result2), 2222);
+ expect(entry.getValue(result3), -3);
+ expect(entry.getResultData(result2).dependedOnResults,
+ unorderedEquals([new TargetedResult(target, result1)]));
+ }
+
test_toString_empty() {
AnalysisTarget target = new TestSource();
CacheEntry entry = new CacheEntry(target);
« no previous file with comments | « pkg/analyzer/test/generated/incremental_resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698