diff options
Diffstat (limited to '')
-rw-r--r-- | tests/run-coverage/yield.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/run-coverage/yield.rs b/tests/run-coverage/yield.rs deleted file mode 100644 index 361275c92..000000000 --- a/tests/run-coverage/yield.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![feature(generators, generator_trait)] -#![allow(unused_assignments)] - -use std::ops::{Generator, GeneratorState}; -use std::pin::Pin; - -fn main() { - let mut generator = || { - yield 1; - return "foo"; - }; - - match Pin::new(&mut generator).resume(()) { - GeneratorState::Yielded(1) => {} - _ => panic!("unexpected value from resume"), - } - match Pin::new(&mut generator).resume(()) { - GeneratorState::Complete("foo") => {} - _ => panic!("unexpected value from resume"), - } - - let mut generator = || { - yield 1; - yield 2; - yield 3; - return "foo"; - }; - - match Pin::new(&mut generator).resume(()) { - GeneratorState::Yielded(1) => {} - _ => panic!("unexpected value from resume"), - } - match Pin::new(&mut generator).resume(()) { - GeneratorState::Yielded(2) => {} - _ => panic!("unexpected value from resume"), - } -} |