()
| 502 | |
| 503 | #[test] |
| 504 | fn test_managed_cache_trait() { |
| 505 | let cache = TtlCache::new(); |
| 506 | |
| 507 | // Add entries |
| 508 | for i in 0..10 { |
| 509 | cache.insert(format!("key_{}", i), format!("value_{}", i)); |
| 510 | } |
| 511 | |
| 512 | assert_eq!(cache.len(), 10); |
| 513 | |
| 514 | // Test eviction |
| 515 | let evicted = cache.evict_percentage(0.5); |
| 516 | |
| 517 | // Should have evicted some entries (exact number depends on cleanup) |
| 518 | assert!(evicted >= 0); |
| 519 | } |
| 520 | |
| 521 | #[test] |
| 522 | fn test_cache_stats() { |
nothing calls this directly
no test coverage detected