mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 05:15:49 -06:00
20 lines
539 B
Rust
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));
|
|
}
|
|
}
|