futures: tests/stream_catch_unwind.rs: Don't break w/o "executor"
Symbols/Imports pushed down / localised
Tests gated with cfg()
Tests now build and pass with all valid feature combinations
See previous commits for details and rationale
+#[cfg(feature = "executor")]
+#[test]
+fn panic_in_the_middle_of_the_stream() {
use futures::executor::block_on_stream;
use futures::stream::{self, StreamExt};
-#[test]
-fn panic_in_the_middle_of_the_stream() {
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());
