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

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

Issue 1129173003: Flush memento objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/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 6d977d60730f03d92af1ba39c5c9c1d0b515b17c..df92bc0771098ea7c54c9a684080f6b8407b49ab 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -420,9 +420,11 @@ class CacheEntryTest extends EngineTestCase {
AnalysisTarget target = new TestSource();
CacheEntry entry = new CacheEntry();
cache.put(target, entry);
+ Object memento1 = 'aaa';
{
- entry.setValue(descriptor1, 1, TargetedResult.EMPTY_LIST, null);
+ entry.setValue(descriptor1, 1, TargetedResult.EMPTY_LIST, memento1);
expect(entry.getState(descriptor1), CacheState.VALID);
+ expect(entry.getMemento(descriptor1), memento1);
}
{
entry.setValue(descriptor2, 2, TargetedResult.EMPTY_LIST, null);
@@ -434,6 +436,7 @@ class CacheEntryTest extends EngineTestCase {
expect(entry.getState(descriptor1), CacheState.FLUSHED);
expect(entry.getState(descriptor2), CacheState.VALID);
expect(entry.getState(descriptor3), CacheState.VALID);
+ expect(entry.getMemento(descriptor1), isNull);
}
}
@@ -717,6 +720,18 @@ class ResultDataTest extends EngineTestCase {
expect(data.state, CacheState.INVALID);
expect(data.value, value);
}
+
+ test_flush() {
+ ResultDescriptor result = new ResultDescriptor('test', -1);
+ ResultData data = new ResultData(result);
+ data.state = CacheState.VALID;
+ data.value = 123;
+ data.memento = 'abc';
+ data.flush();
+ expect(data.state, CacheState.FLUSHED);
+ expect(data.value, -1);
+ expect(data.memento, isNull);
+ }
}
@reflectiveTest
« 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