()
| 139 | |
| 140 | #[test] |
| 141 | fn rejects_beyond_cache_limit() { |
| 142 | let mut cache = FlashblockCache::new(10); |
| 143 | |
| 144 | // Block 16 is the last cacheable block (10 + 5 + 1) |
| 145 | assert!(cache.insert(make_flashblock(16, 0))); |
| 146 | // Block 17 exceeds the limit |
| 147 | assert!(!cache.insert(make_flashblock(17, 0))); |
| 148 | assert_eq!(cache.len(), 1); |
| 149 | } |
| 150 | |
| 151 | #[test] |
| 152 | fn update_canonical_evicts_old_entries() { |