diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-11-01 21:26:53 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-11-07 11:15:19 +1100 |
| commit | e9d04c5e2444526ffde83662f2d57fa35c772891 (patch) | |
| tree | 6dbc04c3253992f8968d5914d7b1c631db528892 /tests/run-coverage/yield.rs | |
| parent | aea7c27eae5e34b11c64ec6d11c75627ef24f8b1 (diff) | |
| download | rust-e9d04c5e2444526ffde83662f2d57fa35c772891.tar.gz rust-e9d04c5e2444526ffde83662f2d57fa35c772891.zip | |
coverage: Migrate `tests/run-coverage` into `tests/coverage`
Diffstat (limited to 'tests/run-coverage/yield.rs')
| -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 b7e2ba31b59..00000000000 --- a/tests/run-coverage/yield.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![feature(coroutines, coroutine_trait)] -#![allow(unused_assignments)] - -use std::ops::{Coroutine, CoroutineState}; -use std::pin::Pin; - -fn main() { - let mut coroutine = || { - yield 1; - return "foo"; - }; - - match Pin::new(&mut coroutine).resume(()) { - CoroutineState::Yielded(1) => {} - _ => panic!("unexpected value from resume"), - } - match Pin::new(&mut coroutine).resume(()) { - CoroutineState::Complete("foo") => {} - _ => panic!("unexpected value from resume"), - } - - let mut coroutine = || { - yield 1; - yield 2; - yield 3; - return "foo"; - }; - - match Pin::new(&mut coroutine).resume(()) { - CoroutineState::Yielded(1) => {} - _ => panic!("unexpected value from resume"), - } - match Pin::new(&mut coroutine).resume(()) { - CoroutineState::Yielded(2) => {} - _ => panic!("unexpected value from resume"), - } -} |
