How to unit test touch controls in Bevy 0.19 version game?
16:52 12 Jul 2026

In Bevy 0.19 version game - I have written below code to process touch controls like drag-n-drop, double tap, etc. I am trying to write unit test for this code but not able to invoke touches via unit test. Some questions I have around this are:

  1. What is the preferred way to process touch inputs? There are gestures(https://docs.rs/bevy_input/0.19.0/bevy_input/gestures/index.html), touch inputs and touches (https://docs.rs/bevy/latest/bevy/input/touch/struct.Touches.html). Which one we have to use?

  2. Is bevy_input crate part of bevy itself or we are supposed to add it separately? Code which I am trying to test and its corresponding unit test (which is not working) is below:

pub fn touch_control_system(
    mut touch_state: ResMut,
    touches: Res,
    time: Res
bevy