MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / test_bcast

Function test_bcast

flow-rs/src/node/bcast.rs:49–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 use crate::sandbox::Sandbox;
48 #[flow_rs::rt::test]
49 async fn test_bcast() {
50 let bcast = Sandbox::pure("Bcast").unwrap();
51 let input = bcast.input("inp").unwrap();
52 let output = bcast.output("out").unwrap();
53 let handle = bcast.start();
54 input.send(Envelope::new(0usize)).await.ok();
55 let envelope = output.recv::<usize>().await;
56 assert!(envelope.is_ok());
57 let envelope = envelope.unwrap();
58 assert_eq!(envelope.get_ref(), &0);
59 assert!(output.is_empty());
60 input.close();
61 handle.await.unwrap();
62 }
63}

Callers

nothing calls this directly

Calls 5

inputMethod · 0.45
outputMethod · 0.45
startMethod · 0.45
sendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected