mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 18:24:09 +02:00
more snapshots
This commit is contained in:
parent
838c3a0dd9
commit
eb4a1379af
6 changed files with 4743 additions and 3 deletions
|
|
@ -51,9 +51,13 @@ impl From<ClassStats> for ClassStatsRaw {
|
|||
}
|
||||
}
|
||||
|
||||
#[test_case("log_6s.log")]
|
||||
#[test_case("log_2788889.log")]
|
||||
#[test_case("log_2892242.log")]
|
||||
fn test_parse(input: &str) {
|
||||
let content = read_to_string(&format!("test_data/{}", input)).unwrap();
|
||||
#[test_case("log_bball.log")]
|
||||
#[test_case("log_hl.log")]
|
||||
fn test_parse(name: &str) {
|
||||
let content = read_to_string(&format!("test_data/{}", name)).unwrap();
|
||||
let (global, per_player) = parse(&content).unwrap();
|
||||
let log = LogResult {
|
||||
global,
|
||||
|
|
@ -62,5 +66,5 @@ fn test_parse(input: &str) {
|
|||
.map(|(key, value)| (key.0.steam3(), value.into()))
|
||||
.collect(),
|
||||
};
|
||||
insta::assert_json_snapshot!(log);
|
||||
insta::assert_json_snapshot!(format!("parse-{}", name), log);
|
||||
}
|
||||
|
|
|
|||
1149
tests/snapshots/snapshot__parse-log_2788889.log.snap
Normal file
1149
tests/snapshots/snapshot__parse-log_2788889.log.snap
Normal file
File diff suppressed because it is too large
Load diff
1745
tests/snapshots/snapshot__parse-log_6s.log.snap
Normal file
1745
tests/snapshots/snapshot__parse-log_6s.log.snap
Normal file
File diff suppressed because it is too large
Load diff
300
tests/snapshots/snapshot__parse-log_bball.log.snap
Normal file
300
tests/snapshots/snapshot__parse-log_bball.log.snap
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
---
|
||||
source: tests/snapshot.rs
|
||||
expression: log
|
||||
---
|
||||
{
|
||||
"global": {
|
||||
"chat": [
|
||||
{
|
||||
"time": 0,
|
||||
"name": "Bv",
|
||||
"steam_id": 76561198048943710,
|
||||
"message": "[P-REC] Stop record.",
|
||||
"chat_type": "Team"
|
||||
},
|
||||
{
|
||||
"time": 0,
|
||||
"name": "Charon",
|
||||
"steam_id": 76561198061714753,
|
||||
"message": "[P-REC] Stop record.",
|
||||
"chat_type": "Team"
|
||||
},
|
||||
{
|
||||
"time": 53,
|
||||
"name": "Bv",
|
||||
"steam_id": 76561198048943710,
|
||||
"message": "[P-REC] Recording...",
|
||||
"chat_type": "Team"
|
||||
},
|
||||
{
|
||||
"time": 53,
|
||||
"name": "Charon",
|
||||
"steam_id": 76561198061714753,
|
||||
"message": "[P-REC] Recording...",
|
||||
"chat_type": "Team"
|
||||
}
|
||||
]
|
||||
},
|
||||
"per_player": {
|
||||
"[U:1:101449025]": {
|
||||
"stats": {
|
||||
"kills": [
|
||||
0,
|
||||
25,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"deaths": [
|
||||
0,
|
||||
32,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"assists": [
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"damage": [
|
||||
0,
|
||||
5039,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"heals": {},
|
||||
"medic": {
|
||||
"advantages_lost": 0,
|
||||
"biggest_advantage_lost": 0.0,
|
||||
"near_full_charge_death": 0,
|
||||
"deaths_after_uber": 0,
|
||||
"avg_time_before_healing": 0.0,
|
||||
"avg_time_to_build": 0.0,
|
||||
"avg_time_to_use": 0.0,
|
||||
"avg_uber_length": 0.0,
|
||||
"charge_count": 0,
|
||||
"drops": 0
|
||||
}
|
||||
},
|
||||
"[U:1:101608870]": {
|
||||
"stats": {
|
||||
"kills": [
|
||||
0,
|
||||
31,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"deaths": [
|
||||
0,
|
||||
28,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"assists": [
|
||||
0,
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"damage": [
|
||||
0,
|
||||
8262,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"heals": {},
|
||||
"medic": {
|
||||
"advantages_lost": 0,
|
||||
"biggest_advantage_lost": 0.0,
|
||||
"near_full_charge_death": 0,
|
||||
"deaths_after_uber": 0,
|
||||
"avg_time_before_healing": 0.0,
|
||||
"avg_time_to_build": 0.0,
|
||||
"avg_time_to_use": 0.0,
|
||||
"avg_uber_length": 0.0,
|
||||
"charge_count": 0,
|
||||
"drops": 0
|
||||
}
|
||||
},
|
||||
"[U:1:82123920]": {
|
||||
"stats": {
|
||||
"kills": [
|
||||
0,
|
||||
31,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"deaths": [
|
||||
0,
|
||||
29,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"assists": [
|
||||
0,
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"damage": [
|
||||
0,
|
||||
6461,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"heals": {},
|
||||
"medic": {
|
||||
"advantages_lost": 0,
|
||||
"biggest_advantage_lost": 0.0,
|
||||
"near_full_charge_death": 0,
|
||||
"deaths_after_uber": 0,
|
||||
"avg_time_before_healing": 0.0,
|
||||
"avg_time_to_build": 0.0,
|
||||
"avg_time_to_use": 0.0,
|
||||
"avg_uber_length": 0.0,
|
||||
"charge_count": 0,
|
||||
"drops": 0
|
||||
}
|
||||
},
|
||||
"[U:1:88677982]": {
|
||||
"stats": {
|
||||
"kills": [
|
||||
0,
|
||||
30,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"deaths": [
|
||||
0,
|
||||
28,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"assists": [
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"damage": [
|
||||
0,
|
||||
5764,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"heals": {},
|
||||
"medic": {
|
||||
"advantages_lost": 0,
|
||||
"biggest_advantage_lost": 0.0,
|
||||
"near_full_charge_death": 0,
|
||||
"deaths_after_uber": 0,
|
||||
"avg_time_before_healing": 0.0,
|
||||
"avg_time_to_build": 0.0,
|
||||
"avg_time_to_use": 0.0,
|
||||
"avg_uber_length": 0.0,
|
||||
"charge_count": 0,
|
||||
"drops": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1542
tests/snapshots/snapshot__parse-log_hl.log.snap
Normal file
1542
tests/snapshots/snapshot__parse-log_hl.log.snap
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue