MCPcopy Create free account
hub / github.com/base/base / test_cache_capacity

Function test_cache_capacity

crates/proof/rpc/src/cache.rs:185–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183
184 #[tokio::test]
185 async fn test_cache_capacity() {
186 let cache: MeteredCache<i32, i32> = MeteredCache::with_capacity("test", 2);
187
188 cache.insert(1, 100).await;
189 cache.insert(2, 200).await;
190
191 // Both should be present
192 assert_eq!(cache.get(&1).await, Some(100));
193 assert_eq!(cache.get(&2).await, Some(200));
194 }
195
196 #[test]
197 fn test_cache_metrics_initial() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected