diff options
Diffstat (limited to 'tests/run-coverage')
| -rw-r--r-- | tests/run-coverage/coroutine.rs (renamed from tests/run-coverage/generator.rs) | 10 | ||||
| -rw-r--r-- | tests/run-coverage/generator.coverage | 16 | ||||
| -rw-r--r-- | tests/run-coverage/yield.rs | 14 |
3 files changed, 20 insertions, 20 deletions
diff --git a/tests/run-coverage/generator.rs b/tests/run-coverage/coroutine.rs index 4ae4f71fcf8..86d19af6f4f 100644 --- a/tests/run-coverage/generator.rs +++ b/tests/run-coverage/coroutine.rs @@ -1,11 +1,11 @@ -#![feature(generators, generator_trait)] +#![feature(coroutines, coroutine_trait)] use std::ops::{Coroutine, CoroutineState}; use std::pin::Pin; // The following implementation of a function called from a `yield` statement // (apparently requiring the Result and the `String` type or constructor) -// creates conditions where the `generator::StateTransform` MIR transform will +// creates conditions where the `coroutine::StateTransform` MIR transform will // drop all `Counter` `Coverage` statements from a MIR. `simplify.rs` has logic // to handle this condition, and still report dead block coverage. fn get_u32(val: bool) -> Result<u32, String> { @@ -14,16 +14,16 @@ fn get_u32(val: bool) -> Result<u32, String> { fn main() { let is_true = std::env::args().len() == 1; - let mut generator = || { + let mut coroutine = || { yield get_u32(is_true); return "foo"; }; - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Yielded(Ok(1)) => {} _ => panic!("unexpected return from resume"), } - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Complete("foo") => {} _ => panic!("unexpected return from resume"), } diff --git a/tests/run-coverage/generator.coverage b/tests/run-coverage/generator.coverage index daba2bea8b8..3a9791a0dbd 100644 --- a/tests/run-coverage/generator.coverage +++ b/tests/run-coverage/generator.coverage @@ -1,11 +1,11 @@ - LL| |#![feature(generators, generator_trait)] + LL| |#![feature(coroutines, coroutine_trait)] LL| | - LL| |use std::ops::{Generator, GeneratorState}; + LL| |use std::ops::{Coroutine, CoroutineState}; LL| |use std::pin::Pin; LL| | LL| |// The following implementation of a function called from a `yield` statement LL| |// (apparently requiring the Result and the `String` type or constructor) - LL| |// creates conditions where the `generator::StateTransform` MIR transform will + LL| |// creates conditions where the `coroutine::StateTransform` MIR transform will LL| |// drop all `Counter` `Coverage` statements from a MIR. `simplify.rs` has logic LL| |// to handle this condition, and still report dead block coverage. LL| 1|fn get_u32(val: bool) -> Result<u32, String> { @@ -15,17 +15,17 @@ LL| | LL| 1|fn main() { LL| 1| let is_true = std::env::args().len() == 1; - LL| 1| let mut generator = || { + LL| 1| let mut coroutine = || { LL| 1| yield get_u32(is_true); LL| 1| return "foo"; LL| 1| }; LL| | - LL| 1| match Pin::new(&mut generator).resume(()) { - LL| 1| GeneratorState::Yielded(Ok(1)) => {} + LL| 1| match Pin::new(&mut coroutine).resume(()) { + LL| 1| CoroutineState::Yielded(Ok(1)) => {} LL| 0| _ => panic!("unexpected return from resume"), LL| | } - LL| 1| match Pin::new(&mut generator).resume(()) { - LL| 1| GeneratorState::Complete("foo") => {} + LL| 1| match Pin::new(&mut coroutine).resume(()) { + LL| 1| CoroutineState::Complete("foo") => {} LL| 0| _ => panic!("unexpected return from resume"), LL| | } LL| 1|} diff --git a/tests/run-coverage/yield.rs b/tests/run-coverage/yield.rs index b347d1967e9..b7e2ba31b59 100644 --- a/tests/run-coverage/yield.rs +++ b/tests/run-coverage/yield.rs @@ -1,36 +1,36 @@ -#![feature(generators, generator_trait)] +#![feature(coroutines, coroutine_trait)] #![allow(unused_assignments)] use std::ops::{Coroutine, CoroutineState}; use std::pin::Pin; fn main() { - let mut generator = || { + let mut coroutine = || { yield 1; return "foo"; }; - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Yielded(1) => {} _ => panic!("unexpected value from resume"), } - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Complete("foo") => {} _ => panic!("unexpected value from resume"), } - let mut generator = || { + let mut coroutine = || { yield 1; yield 2; yield 3; return "foo"; }; - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Yielded(1) => {} _ => panic!("unexpected value from resume"), } - match Pin::new(&mut generator).resume(()) { + match Pin::new(&mut coroutine).resume(()) { CoroutineState::Yielded(2) => {} _ => panic!("unexpected value from resume"), } |
