MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_managed_cache_trait

Function test_managed_cache_trait

src/cache/memory_aware_manager.rs:504–519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

evict_percentageMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected