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

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

Issue 1480393004: Clean source maps during partition dispose. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 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);
« 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