0.1.0-0-pre.8

This commit is contained in:
2026-09-16 09:39:53 +02:00
parent 431665992c
commit 00808ea5a6
21 changed files with 410 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/engines/engine-v1-common/unit_tests/input.rs
// version: 1
// version: 2
#[test]
fn action_state_is_independent() {
@@ -10,3 +10,11 @@ fn action_state_is_independent() {
assert!(!input.is_active(crate::GameAction::Left));
});
}
#[test]
fn pointer_state_is_carried_independently_from_actions() {
let pointer = crate::PointerState::normalized(true, 0.25, 0.75);
let input = crate::InputState::none().with_pointer(pointer);
assert_eq!(input.pointer(), pointer);
assert!(!input.is_active(crate::GameAction::Primary));
}

View File

@@ -0,0 +1,10 @@
// file: crates/engines/engine-v1-common/unit_tests/pointer.rs
// version: 1
#[test]
fn normalized_pointer_clamps_coordinates() {
let pointer = crate::PointerState::normalized(true, -0.5, 1.5);
assert!(pointer.active());
assert_eq!(pointer.x(), 0.0);
assert_eq!(pointer.y(), 1.0);
}