implements PLN-0135
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
This commit is contained in:
@@ -542,6 +542,64 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn games_root_home_click_reaches_game_running() {
|
||||
let root = TestGameRoot::new();
|
||||
root.add_game("stress", true);
|
||||
|
||||
let (mut firmware, mut platform) = hub_home_firmware();
|
||||
firmware.hub.set_game_library(discover_games_root(&root.path));
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
|
||||
let signals = InputSignals { f_signal: true, x_pos: 72, y_pos: 90, ..Default::default() };
|
||||
firmware.tick(&signals, &mut platform);
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
|
||||
assert!(matches!(firmware.state, FirmwareState::GameRunning(_)));
|
||||
assert_eq!(firmware.os.vm().current_cartridge_title(), "Stress");
|
||||
assert_eq!(firmware.os.windows().window_count(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn invalid_games_root_candidate_is_omitted_from_home_launch_boundary() {
|
||||
let root = TestGameRoot::new();
|
||||
root.add_game("broken", false);
|
||||
|
||||
let (mut firmware, mut platform) = hub_home_firmware();
|
||||
let library = discover_games_root(&root.path);
|
||||
assert!(library.is_empty());
|
||||
assert!(!library.diagnostics().is_empty());
|
||||
firmware.hub.set_game_library(library);
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
|
||||
let signals = InputSignals { f_signal: true, x_pos: 72, y_pos: 90, ..Default::default() };
|
||||
firmware.tick(&signals, &mut platform);
|
||||
|
||||
assert!(matches!(firmware.state, FirmwareState::HubHome(_)));
|
||||
assert_eq!(firmware.os.vm().current_cartridge_title(), "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn direct_boot_target_still_reaches_game_running_without_games_root() {
|
||||
let root = TestGameRoot::new();
|
||||
let cart = root.add_game("stress", true);
|
||||
|
||||
let mut firmware = Firmware::new(None);
|
||||
let mut platform = TestPlatform::new();
|
||||
firmware.boot_target = BootTarget::Cartridge {
|
||||
path: cart.display().to_string(),
|
||||
debug: false,
|
||||
debug_port: 7777,
|
||||
};
|
||||
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
firmware.tick(&InputSignals::default(), &mut platform);
|
||||
|
||||
assert!(matches!(firmware.state, FirmwareState::GameRunning(_)));
|
||||
assert_eq!(firmware.os.vm().current_cartridge_title(), "Stress");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hub_home_failed_game_launch_remains_home_and_logs_error() {
|
||||
let root = TestGameRoot::new();
|
||||
|
||||
Reference in New Issue
Block a user