mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-23 11:19:47 +02: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(())
|
||||
}
|
||||
+2
-1
@@ -3,6 +3,7 @@
|
||||
use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::models::map_id::MapId;
|
||||
use wotbreplay_parser::replay::Replay;
|
||||
|
||||
#[test]
|
||||
@@ -14,7 +15,7 @@ fn meta_ok() -> Result<()> {
|
||||
assert_eq!(meta.arena_unique_id, "1661909200500084");
|
||||
assert_eq!(meta.battle_duration_secs, 164.08485);
|
||||
assert_eq!(meta.tank_id, 26657);
|
||||
// TODO: assert_eq!(meta.map_id);
|
||||
assert_eq!(meta.map_id, MapId::DynastyPearl);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user