MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / basic_cache_roundtrip

Function basic_cache_roundtrip

nodedb/src/engine/timeseries/query_cache.rs:154–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152
153 #[test]
154 fn basic_cache_roundtrip() {
155 let mut cache = QueryCache::new(1024 * 1024);
156 let data = vec![1u8, 2, 3, 4];
157 cache.insert(T1, 100, 42, data.clone());
158 assert_eq!(cache.get(T1, 100, 42), Some(data.as_slice()));
159 assert_eq!(cache.len(), 1);
160 }
161
162 #[test]
163 fn cache_miss() {

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected