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

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

Issue 1120313004: Get memento objects from tasks, remember in cache and pass back to tasks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
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 f635ab9ce908dd2e0863ad3e59c7b0eb66f62dd2..e3cc80469ff9a72549f73c1c89b46a01c21027d3 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -208,6 +208,13 @@ class CacheEntryTest extends EngineTestCase {
expect(entry.getValue(result), defaultValue);
}
+ test_getMemento_noResult() {
+ String defaultValue = 'value';
+ ResultDescriptor result = new ResultDescriptor('test', defaultValue);
+ CacheEntry entry = new CacheEntry();
+ expect(entry.getMemento(result), null);
+ }
+
test_hasAstStructure_false() {
CacheEntry entry = new CacheEntry();
expect(entry.hasAstStructure, false);
@@ -367,13 +374,15 @@ class CacheEntryTest extends EngineTestCase {
ResultDescriptor result = new ResultDescriptor('test', 1);
CacheEntry entry = new CacheEntry();
// set VALID
- entry.setValue(result, 10, TargetedResult.EMPTY_LIST);
+ String memento = 'main() {}';
+ entry.setValue(result, 10, TargetedResult.EMPTY_LIST, memento);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), 10);
// set INVALID
entry.setState(result, CacheState.INVALID);
expect(entry.getState(result), CacheState.INVALID);
expect(entry.getValue(result), 1);
+ expect(entry.getMemento(result), memento);
}
test_setState_invalid_invalidateDependent() {
@@ -417,12 +426,14 @@ class CacheEntryTest extends EngineTestCase {
}
test_setValue() {
- String value = 'value';
ResultDescriptor result = new ResultDescriptor('test', null);
+ String value = 'value';
+ String memento = 'main() {}';
CacheEntry entry = new CacheEntry();
- entry.setValue(result, value, TargetedResult.EMPTY_LIST);
+ entry.setValue(result, value, TargetedResult.EMPTY_LIST, memento);
expect(entry.getState(result), CacheState.VALID);
expect(entry.getValue(result), value);
+ expect(entry.getMemento(result), memento);
}
test_setValue_invalidateDependent() {

Powered by Google App Engine
This is Rietveld 408576698