fn check_events(
    stream: StoreEventStream<impl Stream<Item = StoreEvent, Error = ()> + Send>,
    expected: Vec<StoreEvent>,
) -> impl Future<Item = (), Error = graph::tokio_timer::timeout::Error<()>> {
    stream
        .take(expected.len() as u64)
        .collect()
        .timeout(Duration::from_secs(3))
        .and_then(move |events| {
            assert_eq!(events.len(), expected.len());
            assert_eq!(events, expected);
            Ok(())
        })
        .and_then(|_| Ok(()))
}
// Get as many events as expected contains from stream and check that they
// are equal to the expected events
Get as many events as expected contains from stream and check that they
are equal to the expected events
Get as many events as expected contains from stream and check that they are equal to the expected events
fn check_events(
    stream: StoreEventStream<impl Stream<Item = StoreEvent, Error = ()> + Send>,
    expected: Vec<StoreEvent>,
) -> impl Future<Item = (), Error = graph::tokio_timer::timeout::Error<()>> {
    stream
        .take(expected.len() as u64)
        .collect()
        .timeout(Duration::from_secs(3))
        .and_then(move |events| {
            assert_eq!(events.len(), expected.len());
            assert_eq!(events, expected);
            Ok(())
        })
        .and_then(|_| Ok(()))
}
fn check_events ( stream : StoreEventStream < impl Stream < Item = StoreEvent , Error = ( ) > + Send > , expected : Vec < StoreEvent > , ) -> impl Future < Item = ( ) , Error = graph :: tokio_timer :: timeout :: Error < ( ) > > { stream . take ( expected . len ( ) as u64 ) . collect ( ) . timeout ( Duration :: from_secs ( 3 ) ) . and_then ( move | events | { assert_eq ! ( events len ( ) expected len ( ) ) ; assert_eq ! ( events expected ) ; Ok ( ( ) ) } ) . and_then ( | _ | Ok ( ( ) ) ) }
Get as many events as expected contains from stream and check that they
are equal to the expected events
Get as many events as expected contains from stream and check that they are equal to the expected events
stream
StoreEventStream<impl Stream<Item = StoreEvent, Error = ()> + Send>
expected
Vec<StoreEvent>
stream
StoreEventStream<impl Stream<Item = StoreEvent, Error = ()> + Send>
expected
Vec<StoreEvent>