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

Function put_and_get

nodedb/src/engine/sparse/btree.rs:446–456  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

444
445 #[test]
446 fn put_and_get() {
447 let (engine, _dir) = open_temp();
448 engine.put(1, "users", "u1", b"alice").unwrap();
449 engine.put(1, "users", "u2", b"bob").unwrap();
450 assert_eq!(
451 engine.get(1, "users", "u1").unwrap(),
452 Some(b"alice".to_vec())
453 );
454 assert_eq!(engine.get(1, "users", "u2").unwrap(), Some(b"bob".to_vec()));
455 assert_eq!(engine.get(1, "users", "u3").unwrap(), None);
456 }
457
458 #[test]
459 fn put_overwrites() {

Callers

nothing calls this directly

Calls 2

open_tempFunction · 0.70
putMethod · 0.45

Tested by

no test coverage detected