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

Function decode_no_group_response

nodedb/src/event/alert/executor.rs:360–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

358
359 #[test]
360 fn decode_no_group_response() {
361 let row = rmpv::Value::Map(vec![(
362 rmpv::Value::String("max_cpu".into()),
363 rmpv::Value::F64(99.1),
364 )]);
365 let array = rmpv::Value::Array(vec![row]);
366 let mut buf = Vec::new();
367 rmpv::encode::write_value(&mut buf, &array).unwrap();
368
369 let results = decode_aggregate_response(&buf, &[], "max").unwrap();
370 assert_eq!(results.len(), 1);
371 assert_eq!(results[0].0, "__all__");
372 assert!((results[0].1 - 99.1).abs() < 1e-12);
373 }
374}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected