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

Function diameter_single_node

nodedb/src/engine/graph/algo/diameter.rs:229–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227
228 #[test]
229 fn diameter_single_node() {
230 let mut csr = CsrIndex::new();
231 csr.add_node("solo").unwrap();
232 csr.compact().expect("no governor, cannot fail");
233
234 let batch = run(
235 &csr,
236 &AlgoParams {
237 mode: Some("EXACT".into()),
238 ..Default::default()
239 },
240 );
241 let json = batch.to_json().unwrap();
242 let rows: Vec<serde_json::Value> = serde_json::from_slice(&json).unwrap();
243 assert_eq!(rows[0]["diameter"].as_i64().unwrap(), 0);
244 }
245}

Callers

nothing calls this directly

Calls 5

runFunction · 0.70
add_nodeMethod · 0.45
expectMethod · 0.45
compactMethod · 0.45
to_jsonMethod · 0.45

Tested by

no test coverage detected