diff options
Diffstat (limited to 'tests/stream_catch_unwind.rs')
-rw-r--r-- | tests/stream_catch_unwind.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/stream_catch_unwind.rs b/tests/stream_catch_unwind.rs index 8b23a0a..94c7a75 100644 --- a/tests/stream_catch_unwind.rs +++ b/tests/stream_catch_unwind.rs @@ -1,8 +1,9 @@ -use futures::executor::block_on_stream; -use futures::stream::{self, StreamExt}; - +#[cfg(feature = "executor")] #[test] fn panic_in_the_middle_of_the_stream() { + use futures::executor::block_on_stream; + use futures::stream::{self, StreamExt}; + let stream = stream::iter(vec![Some(10), None, Some(11)]); // panic on second element @@ -14,8 +15,12 @@ fn panic_in_the_middle_of_the_stream() { assert!(iter.next().is_none()); } +#[cfg(feature = "executor")] #[test] fn no_panic() { + use futures::executor::block_on_stream; + use futures::stream::{self, StreamExt}; + let stream = stream::iter(vec![10, 11, 12]); let mut iter = block_on_stream(stream.catch_unwind()); |