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

Function incr_float_existing

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

Source from the content-addressed store, hash-verified

553
554 #[test]
555 fn incr_float_existing() {
556 let mut engine = make_engine();
557 engine.incr_float(1, "scores", b"dmg", 3.0, 1000).unwrap();
558 let result = engine.incr_float(1, "scores", b"dmg", 1.5, 1000);
559 assert!((result.unwrap() - 4.5).abs() < f64::EPSILON);
560 }
561
562 #[test]
563 fn incr_float_infinity_rejected() {

Callers

nothing calls this directly

Calls 2

incr_floatMethod · 0.80
make_engineFunction · 0.70

Tested by

no test coverage detected