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