mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-21 10:27:01 +02:00
New: add clan_tag
This commit is contained in:
1 parent
7376cfc97e
commit
e1f38014b8
2 files changed
+15
No files matched your search
@@ -57,6 +57,9 @@ pub struct PlayerInfo {
|
||||
/// Player's team assignment.
|
||||
#[prost(enumeration = "TeamNumber", tag = "3")]
|
||||
pub team_number: i32,
|
||||
|
||||
#[prost(string, optional, tag = "5")]
|
||||
pub clan_tag: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, prost::Enumeration)]
|
||||
|
||||
@@ -86,3 +86,15 @@ fn player_results_ok() -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn clan_tags_ok() -> Result<()> {
|
||||
let battle_results = Replay::open(File::open("tests/replays/player_results_ok.wotbreplay")?)?
|
||||
.read_battle_results()?;
|
||||
|
||||
assert_eq!(battle_results.players[1].info.clan_tag.as_deref(), Some("AN0NY"));
|
||||
assert_eq!(battle_results.players[10].info.clan_tag.as_deref(), Some("BBS"));
|
||||
assert_eq!(battle_results.players[11].info.clan_tag, None);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user