()
| 89 | |
| 90 | #[test] |
| 91 | fn test_lru_cache_remove() { |
| 92 | let mut cache: LruCache<u32, String> = LruCache::new(3); |
| 93 | |
| 94 | cache.insert(1, "one".to_string()); |
| 95 | assert!(cache.contains_key(&1)); |
| 96 | |
| 97 | let removed = cache.remove(&1); |
| 98 | assert!(removed); |
| 99 | assert!(!cache.contains_key(&1)); |
| 100 | |
| 101 | let removed_again = cache.remove(&1); |
| 102 | assert!(!removed_again); |
| 103 | } |
| 104 | |
| 105 | #[test] |
| 106 | fn test_lru_cache_update_existing() { |