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

Function test_cache_clear

src/cache/ttl_cache.rs:774–786  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

772
773 #[test]
774 fn test_cache_clear() {
775 let cache = TtlCache::new();
776
777 cache.insert("key1".to_string(), "value1".to_string());
778 cache.insert("key2".to_string(), "value2".to_string());
779
780 assert_eq!(cache.len(), 2);
781
782 cache.clear();
783
784 assert_eq!(cache.len(), 0);
785 assert!(cache.is_empty());
786 }
787
788 #[test]
789 fn test_ttl_extension() {

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected