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

Function incr_negative_delta

nodedb/src/engine/kv/engine_atomic.rs:497–502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

495
496 #[test]
497 fn incr_negative_delta() {
498 let mut engine = make_engine();
499 engine.incr(1, "counters", b"gold", 100, 0, 1000).unwrap();
500 let result = engine.incr(1, "counters", b"gold", -30, 0, 1000);
501 assert_eq!(result.unwrap(), 70);
502 }
503
504 #[test]
505 fn incr_overflow() {

Callers

nothing calls this directly

Calls 2

incrMethod · 0.80
make_engineFunction · 0.70

Tested by

no test coverage detected