mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-11-01 06:39:49 +01:00
✨ Add more maps, fix the enum
This commit is contained in:
1 parent
1313bc82f7
commit
da0646f40a
8 files changed
+45
-5
No files matched your search
@@ -2,6 +2,7 @@ use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::models::battle_results::BattleResults;
|
||||
use wotbreplay_parser::models::room_type::RoomType;
|
||||
use wotbreplay_parser::replay::Replay;
|
||||
|
||||
#[test]
|
||||
@@ -13,6 +14,7 @@ fn player_results_ok() -> Result<()> {
|
||||
let battle_results: BattleResults = battle_results_dat.try_into()?;
|
||||
|
||||
assert_eq!(battle_results.winner_team_number, Some(2));
|
||||
assert_eq!(battle_results.room_type(), RoomType::Regular);
|
||||
|
||||
assert_eq!(battle_results.author.team_number, 2);
|
||||
assert_eq!(battle_results.author.credits_earned, 59518);
|
||||
@@ -127,3 +129,13 @@ fn draw_ok() -> Result<()> {
|
||||
assert_eq!(battle_results.winner_team_number, None);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn room_type_ok() -> Result<()> {
|
||||
let battle_results = Replay::open(File::open(
|
||||
"replays/20230512_2150__helaas_pindakaas_R159_SU_130PM_15146680594634860.wotbreplay",
|
||||
)?)?
|
||||
.read_battle_results()?;
|
||||
assert_eq!(battle_results.room_type(), RoomType::MadGames);
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user