mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-23 19:29:48 +02:00
Break: add initial meta.json support
This commit is contained in:
1 parent
903cd00f32
commit
14148c7410
10 files changed
+71
-19
No files matched your search
@@ -8,7 +8,7 @@ fn player_results_ok() -> Result<()> {
|
||||
let battle_results_dat = Replay::open(File::open("tests/replays/player_results.wotbreplay")?)?
|
||||
.read_battle_results_dat()?;
|
||||
assert_eq!(battle_results_dat.arena_unique_id, 1661909200500084);
|
||||
let battle_results = battle_results_dat.decode_battle_results()?;
|
||||
let battle_results: BattleResults = battle_results_dat.try_into()?;
|
||||
|
||||
let snak_the_ripper_info = &battle_results.player_results[3].info;
|
||||
assert_eq!(snak_the_ripper_info.base_xp, 929);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn meta_ok() -> Result<()> {
|
||||
let meta = Replay::open(File::open("tests/replays/player_results.wotbreplay")?)?.read_meta()?;
|
||||
|
||||
assert_eq!(meta.player_name, "zeekrab");
|
||||
assert_eq!(meta.arena_unique_id, "1661909200500084");
|
||||
assert_eq!(meta.battle_duration_secs, 164.08485);
|
||||
assert_eq!(meta.tank_id, 26657);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user