Skip to content

Commit

Permalink
Improve out of order test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Oct 27, 2024
1 parent 34e97ac commit 2b36a48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/input_context/input_condition/combo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,14 @@ mod tests {
let mut condition = Combo::default()
.step::<ActionA>(0.5)
.step::<ActionB>(0.5)
.step::<ActionC>(0.5);
.step::<ActionC>(0.5)
.cancel_action::<ActionD>(); // Out of order is relevant only for non-any cancel actions.
let time = Time::default();
let mut actions = ActionsData::default();
set_action::<ActionA>(&time, &mut actions, ActionState::None);
set_action::<ActionB>(&time, &mut actions, ActionState::Fired);
set_action::<ActionC>(&time, &mut actions, ActionState::None);
set_action::<ActionD>(&time, &mut actions, ActionState::None);

assert_eq!(
condition.evaluate(&actions, &time, 0.0.into()),
Expand Down Expand Up @@ -516,4 +518,8 @@ mod tests {
#[derive(Debug, InputAction)]
#[input_action(dim = Bool)]
struct ActionC;

#[derive(Debug, InputAction)]
#[input_action(dim = Bool)]
struct ActionD;
}

0 comments on commit 2b36a48

Please sign in to comment.