Chromium Code Reviews| 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 75c156a69de0055b3a63ada42df1875230d81a88..fad37467b4dd9631b1f662a537683c48c9df4718 100644 |
| --- a/pkg/analyzer/test/src/context/cache_test.dart |
| +++ b/pkg/analyzer/test/src/context/cache_test.dart |
| @@ -961,12 +961,29 @@ abstract class CachePartitionTest extends EngineTestCase { |
| expect(createPartition(), isNotNull); |
| } |
| + void test_dispose() { |
| + CachePartition partition = createPartition(); |
| + Source source1 = new TestSource('/1.dart'); |
| + Source source2 = new TestSource('/2.dart'); |
| + CacheEntry entry1 = new CacheEntry(source1); |
| + CacheEntry entry2 = new CacheEntry(source2); |
| + // add two sources |
| + partition.put(entry1); |
| + partition.put(entry2); |
| + expect(partition.sources, unorderedEquals([source1, source2])); |
| + expect(partition.pathToSource, hasLength(2)); |
| + // dispose, no sources |
| + partition.dispose(); |
| + expect(partition.sources, isEmpty); |
| + expect(partition.pathToSource, isEmpty); |
|
Brian Wilkerson
2015/12/01 14:50:17
expect(partition.entryMap, isEmpty); ?
|
| + } |
| + |
| void test_entrySet() { |
| CachePartition partition = createPartition(); |
| AnalysisTarget target = new TestSource(); |
| CacheEntry entry = new CacheEntry(target); |
| partition.put(entry); |
| - Map<AnalysisTarget, CacheEntry> entryMap = partition.map; |
| + Map<AnalysisTarget, CacheEntry> entryMap = partition.entryMap; |
| expect(entryMap, hasLength(1)); |
| AnalysisTarget entryKey = entryMap.keys.first; |
| expect(entryKey, target); |