mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 10:14:11 +02:00
support TF2 Sol 1vs1
This commit is contained in:
parent
65d58569b0
commit
0d2eb1ee54
4 changed files with 3314 additions and 0 deletions
3288
tests/data/team_2909.html
Normal file
3288
tests/data/team_2909.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -38,6 +38,7 @@ fn test_parse_player_details_html(input: &str, name: &str) {
|
||||||
#[test_case("team_29228.html", "team_newlines_join_date")]
|
#[test_case("team_29228.html", "team_newlines_join_date")]
|
||||||
#[test_case("team_10763.html", "team_na_4v4")]
|
#[test_case("team_10763.html", "team_na_4v4")]
|
||||||
#[test_case("team_3975.html", "team_empty_player")]
|
#[test_case("team_3975.html", "team_empty_player")]
|
||||||
|
#[test_case("team_2909.html", "team_1v1_sol")]
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
fn test_parse_team_html(input: &str, name: &str) {
|
fn test_parse_team_html(input: &str, name: &str) {
|
||||||
let body = read_to_string(format!("tests/data/{input}")).unwrap();
|
let body = read_to_string(format!("tests/data/{input}")).unwrap();
|
||||||
|
|
|
||||||
19
tests/snapshots/snapshot__parse_team_1v1_sol_html.snap
Normal file
19
tests/snapshots/snapshot__parse_team_1v1_sol_html.snap
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
source: tests/snapshot.rs
|
||||||
|
expression: parsed
|
||||||
|
---
|
||||||
|
{
|
||||||
|
"name": "TruckerPete",
|
||||||
|
"tag": "{RoFL}",
|
||||||
|
"image": null,
|
||||||
|
"format": "1v1",
|
||||||
|
"region": null,
|
||||||
|
"timezone": null,
|
||||||
|
"steam_group": null,
|
||||||
|
"division": "Eliminated Players",
|
||||||
|
"description": "",
|
||||||
|
"titles": [],
|
||||||
|
"members": [],
|
||||||
|
"results": [],
|
||||||
|
"name_changes": []
|
||||||
|
}
|
||||||
|
|
@ -329,6 +329,7 @@ pub enum GameMode {
|
||||||
Sixes,
|
Sixes,
|
||||||
Fours,
|
Fours,
|
||||||
Ultiduo,
|
Ultiduo,
|
||||||
|
Ones,
|
||||||
FFFours,
|
FFFours,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -342,12 +343,14 @@ impl FromStr for GameMode {
|
||||||
"6v6" => Ok(GameMode::Sixes),
|
"6v6" => Ok(GameMode::Sixes),
|
||||||
"4v4" => Ok(GameMode::Fours),
|
"4v4" => Ok(GameMode::Fours),
|
||||||
"2v2" => Ok(GameMode::Ultiduo),
|
"2v2" => Ok(GameMode::Ultiduo),
|
||||||
|
"1v1" => Ok(GameMode::Ones),
|
||||||
"TF2 Highlander" => Ok(GameMode::Highlander),
|
"TF2 Highlander" => Ok(GameMode::Highlander),
|
||||||
"ASIA TF2-H" => Ok(GameMode::Highlander),
|
"ASIA TF2-H" => Ok(GameMode::Highlander),
|
||||||
"TF2 8vs8" => Ok(GameMode::Eights),
|
"TF2 8vs8" => Ok(GameMode::Eights),
|
||||||
"TF2 6vs6" => Ok(GameMode::Sixes),
|
"TF2 6vs6" => Ok(GameMode::Sixes),
|
||||||
"TF2 4vs4" => Ok(GameMode::Fours),
|
"TF2 4vs4" => Ok(GameMode::Fours),
|
||||||
"TF2 2vs2" => Ok(GameMode::Ultiduo),
|
"TF2 2vs2" => Ok(GameMode::Ultiduo),
|
||||||
|
"TF2 Sol 1vs1" => Ok(GameMode::Ones),
|
||||||
"ff4v4" => Ok(GameMode::FFFours),
|
"ff4v4" => Ok(GameMode::FFFours),
|
||||||
"FF 4vs4 OvsD" => Ok(GameMode::FFFours),
|
"FF 4vs4 OvsD" => Ok(GameMode::FFFours),
|
||||||
_ => Err(InvalidGameMode {
|
_ => Err(InvalidGameMode {
|
||||||
|
|
@ -365,6 +368,7 @@ impl GameMode {
|
||||||
GameMode::Sixes => "6",
|
GameMode::Sixes => "6",
|
||||||
GameMode::Fours => "4",
|
GameMode::Fours => "4",
|
||||||
GameMode::Ultiduo => "2",
|
GameMode::Ultiduo => "2",
|
||||||
|
GameMode::Ones => "1",
|
||||||
GameMode::FFFours => "ff4",
|
GameMode::FFFours => "ff4",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -376,6 +380,7 @@ impl GameMode {
|
||||||
GameMode::Sixes => "6v6",
|
GameMode::Sixes => "6v6",
|
||||||
GameMode::Fours => "4v4",
|
GameMode::Fours => "4v4",
|
||||||
GameMode::Ultiduo => "2v2",
|
GameMode::Ultiduo => "2v2",
|
||||||
|
GameMode::Ones => "1v1",
|
||||||
GameMode::FFFours => "ff4v4",
|
GameMode::FFFours => "ff4v4",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -387,6 +392,7 @@ impl GameMode {
|
||||||
GameMode::Sixes => true,
|
GameMode::Sixes => true,
|
||||||
GameMode::Fours => true,
|
GameMode::Fours => true,
|
||||||
GameMode::Ultiduo => true,
|
GameMode::Ultiduo => true,
|
||||||
|
GameMode::Ones => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue