[−][src]Macro tari_test_utils::collect_stream
Collect $take items from a stream or timeout for Duration $timeout. Requires the tokio
runtime
ⓘThis code runs with edition 2018
let mut rt = Runtime::new().unwrap(); let stream = stream::iter(1..10); assert_eq!(collect_stream!(rt, stream, take=3, timeout=Duration::from_secs(1)), vec![1,2,3]);