mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
12 lines
367 B
Rust
12 lines
367 B
Rust
use tokio_stream::{StreamExt, StreamNotifyClose};
|
|
|
|
#[tokio::test]
|
|
async fn basic_usage() {
|
|
let mut stream = StreamNotifyClose::new(tokio_stream::iter(vec![0, 1]));
|
|
|
|
assert_eq!(stream.next().await, Some(Some(0)));
|
|
assert_eq!(stream.next().await, Some(Some(1)));
|
|
assert_eq!(stream.next().await, Some(None));
|
|
assert_eq!(stream.next().await, None);
|
|
}
|