1
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
use serde_json::json;
|
||||
|
||||
use shared_contracts::runtime_story::{RuntimeStoryActionRequest, RuntimeStoryChoiceAction, RuntimeStoryPatch};
|
||||
use shared_contracts::runtime_story::{
|
||||
RuntimeStoryActionRequest, RuntimeStoryChoiceAction, RuntimeStoryPatch,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
battle::resolve_battle_action,
|
||||
build_status_patch,
|
||||
read_bool_field,
|
||||
read_i32_field,
|
||||
battle::resolve_battle_action, build_status_patch, read_bool_field, read_i32_field,
|
||||
read_optional_string_field,
|
||||
};
|
||||
|
||||
@@ -82,6 +81,12 @@ fn battle_resolution_prefers_player_defeat_when_both_sides_fall_in_same_turn() {
|
||||
resolution.patches.first(),
|
||||
Some(RuntimeStoryPatch::BattleResolved { outcome, .. }) if outcome == "defeat"
|
||||
));
|
||||
assert_eq!(resolution.patches.get(1), Some(&build_status_patch(&game_state)));
|
||||
assert_eq!(resolution.battle.and_then(|battle| battle.outcome), Some("defeat".to_string()));
|
||||
assert_eq!(
|
||||
resolution.patches.get(1),
|
||||
Some(&build_status_patch(&game_state))
|
||||
);
|
||||
assert_eq!(
|
||||
resolution.battle.and_then(|battle| battle.outcome),
|
||||
Some("defeat".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user