aboutsummaryrefslogtreecommitdiff
path: root/tests/stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stream.rs')
-rw-r--r--tests/stream.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/stream.rs b/tests/stream.rs
index e46fc5a..bc9c742 100644
--- a/tests/stream.rs
+++ b/tests/stream.rs
@@ -101,7 +101,7 @@ async fn return_stream() {
#[tokio::test]
async fn consume_channel() {
- let (mut tx, mut rx) = mpsc::channel(10);
+ let (tx, mut rx) = mpsc::channel(10);
let s = stream! {
while let Some(v) = rx.recv().await {
@@ -158,6 +158,20 @@ async fn stream_in_stream() {
assert_eq!(3, values.len());
}
+#[tokio::test]
+async fn yield_non_unpin_value() {
+ let s: Vec<_> = stream! {
+ for i in 0..3 {
+ yield async move { i };
+ }
+ }
+ .buffered(1)
+ .collect()
+ .await;
+
+ assert_eq!(s, vec![0, 1, 2]);
+}
+
#[test]
fn test() {
let t = trybuild::TestCases::new();