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

Function overflow_values

nodedb/src/engine/kv/hash_table/api.rs:400–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398
399 #[test]
400 fn overflow_values() {
401 let mut t = KvHashTable::new(16, 0.75, 4, 8); // 8-byte inline threshold.
402 let small = b"tiny".to_vec(); // 4 bytes — inline.
403 let large = vec![0xAB; 100]; // 100 bytes — overflow.
404
405 t.put(b"s", &small, NO_EXPIRY, Surrogate::ZERO);
406 t.put(b"l", &large, NO_EXPIRY, Surrogate::ZERO);
407
408 assert_eq!(t.get(b"s", 0), Some(small.as_slice()));
409 assert_eq!(t.get(b"l", 0), Some(large.as_slice()));
410 }
411
412 #[test]
413 fn many_inserts_and_deletes_no_corruption() {

Callers

nothing calls this directly

Calls 2

to_vecMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected