Files
Pac-Man/tests/events.rs
Ryan Walters 9624bcf359 feat: collision helper, ghost/pacman collision events, collision tests
minor format updates from copilot's commit
2025-08-27 22:26:49 -05:00

20 lines
539 B
Rust

use pacman::events::{GameCommand, GameEvent};
use pacman::map::direction::Direction;
#[test]
fn test_game_command_to_game_event_conversion_all_variants() {
let commands = vec![
GameCommand::Exit,
GameCommand::MovePlayer(Direction::Up),
GameCommand::ToggleDebug,
GameCommand::MuteAudio,
GameCommand::ResetLevel,
GameCommand::TogglePause,
];
for command in commands {
let event: GameEvent = command.into();
assert_eq!(event, GameEvent::Command(command));
}
}