Skip to content

Commit

Permalink
add window field in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matiqo15 committed Jan 3, 2024
1 parent e7791c9 commit dd90483
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/bevy_input/src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,15 @@ mod test {
#[test]
fn release_touch() {
use crate::{touch::TouchPhase, TouchInput, Touches};
use bevy_ecs::entity::Entity;
use bevy_math::Vec2;

let mut touches = Touches::default();

let touch_event = TouchInput {
phase: TouchPhase::Started,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 4,
};
Expand All @@ -651,20 +653,23 @@ mod test {
#[test]
fn release_all_touches() {
use crate::{touch::TouchPhase, TouchInput, Touches};
use bevy_ecs::entity::Entity;
use bevy_math::Vec2;

let mut touches = Touches::default();

let touch_pressed_event = TouchInput {
phase: TouchPhase::Started,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 4,
};

let touch_moved_event = TouchInput {
phase: TouchPhase::Moved,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 4,
};
Expand All @@ -686,27 +691,31 @@ mod test {
#[test]
fn clear_touches() {
use crate::{touch::TouchPhase, TouchInput, Touches};
use bevy_ecs::entity::Entity;
use bevy_math::Vec2;

let mut touches = Touches::default();

let touch_press_event = TouchInput {
phase: TouchPhase::Started,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 4,
};

let touch_canceled_event = TouchInput {
phase: TouchPhase::Canceled,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 5,
};

let touch_released_event = TouchInput {
phase: TouchPhase::Ended,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 6,
};
Expand All @@ -732,27 +741,31 @@ mod test {
#[test]
fn reset_all_touches() {
use crate::{touch::TouchPhase, TouchInput, Touches};
use bevy_ecs::entity::Entity;
use bevy_math::Vec2;

let mut touches = Touches::default();

let touch_press_event = TouchInput {
phase: TouchPhase::Started,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 4,
};

let touch_canceled_event = TouchInput {
phase: TouchPhase::Canceled,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 5,
};

let touch_released_event = TouchInput {
phase: TouchPhase::Ended,
position: Vec2::splat(4.0),
window: Entity::PLACEHOLDER,
force: None,
id: 6,
};
Expand Down

0 comments on commit dd90483

Please sign in to comment.