| 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() {
|
|
|