This commit is contained in:
cscherrNT 2024-01-12 13:47:59 +00:00 committed by github-actions[bot]
parent 08c153049a
commit 54dbbae173
2 changed files with 3 additions and 5 deletions

View File

@ -36,8 +36,8 @@ impl AnimalWorld {
#[given(regex = r"^a (hungry|satiated) cat$")] #[given(regex = r"^a (hungry|satiated) cat$")]
async fn hungry_cat(world: &mut AnimalWorld, state: String) { async fn hungry_cat(world: &mut AnimalWorld, state: String) {
match state.as_str() { match state.as_str() {
"hungry" => world.cat.hungry = true, "hungry" => world.cat.hungry = true,
"satiated" => world.cat.hungry = false, "satiated" => world.cat.hungry = false,
_ => unreachable!(), _ => unreachable!(),
} }
} }

View File

@ -1,5 +1,3 @@
use revsqrt::*;
use cucumber::{given, then, when, World}; use cucumber::{given, then, when, World};
use rand; use rand;
@ -11,7 +9,7 @@ pub struct NumWorld {
// is n about the same as m? // is n about the same as m?
fn about_same(n: f32, m: f32) -> bool { fn about_same(n: f32, m: f32) -> bool {
(n - m)*1000f32 < 1f32 (n - m) * 1000f32 < 1f32
} }
// Steps are defined with `given`, `when` and `then` attributes. // Steps are defined with `given`, `when` and `then` attributes.