mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-21 10:27:01 +02:00
Break: read some of data.wotreplay
This commit is contained in:
1 parent
8e96f4847b
commit
615537ce45
10 files changed
+200
-41
No files matched your search
+3
-10
@@ -10,6 +10,9 @@ fn player_results_ok() -> Result<()> {
|
||||
assert_eq!(battle_results_dat.arena_unique_id, 1661909200500084);
|
||||
let battle_results: BattleResults = battle_results_dat.try_into()?;
|
||||
|
||||
assert_eq!(battle_results.winner_team_number, 2);
|
||||
assert_eq!(battle_results.author.team_number, 2);
|
||||
|
||||
let snak_the_ripper_info = &battle_results.player_results[3].info;
|
||||
assert_eq!(snak_the_ripper_info.base_xp, 929);
|
||||
assert_eq!(snak_the_ripper_info.damage_dealt, 2584);
|
||||
@@ -108,16 +111,6 @@ fn victory_points_ok() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn winning_team_ok() -> Result<()> {
|
||||
let battle_results = Replay::open(File::open("tests/replays/winning_team.wotbreplay")?)?
|
||||
.read_battle_results()?;
|
||||
|
||||
assert_eq!(battle_results.winning_team(), TeamNumber::One);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn author_results_ok() -> Result<()> {
|
||||
let battle_results = Replay::open(File::open("tests/replays/author_results.wotbreplay")?)?
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
use std::fs::File;
|
||||
|
||||
use anyhow::Result;
|
||||
use wotbreplay_parser::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn data_ok() -> Result<()> {
|
||||
let mut replay = Replay::open(File::open("tests/replays/player_results.wotbreplay")?)?;
|
||||
let data = replay.read_data()?;
|
||||
|
||||
assert_eq!(data.client_version, "9.4.0_apple");
|
||||
assert_eq!(data.author_nickname, "zeekrab");
|
||||
assert_eq!(data.arena_unique_id, 1661909200500084);
|
||||
assert_eq!(data.arena_type_id, 65567);
|
||||
assert_eq!(data.summary.battle_level, 8);
|
||||
assert_eq!(data.summary.battle_category_id, 13);
|
||||
assert!(data.summary.is_mouse_enabled);
|
||||
assert_eq!(data.summary.matchmaker_type, 2);
|
||||
assert_eq!(data.summary.camouflage_slot, 1);
|
||||
assert_eq!(data.summary.average_mmr, [-25.396859946846963, 77.58806455880404]);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user