1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

gamestate improvements

This commit is contained in:
Robin Appelman 2022-08-25 23:54:46 +02:00
commit 307a6cf953
7 changed files with 1710 additions and 65 deletions

View file

@ -40,11 +40,18 @@ fn game_state_test(input_file: &str, snapshot_file: &str) {
.parse()
.unwrap();
// fs::write(
// format!("test_data/{}", snapshot_file),
// serde_json::to_string_pretty(&state).unwrap(),
// )
// .unwrap();
let expected: GameState = serde_json::from_slice(
fs::read(format!("test_data/{}", snapshot_file))
.expect("Unable to read file")
.as_slice(),
)
.unwrap();
pretty_assertions::assert_eq!(expected.players, state.players);
pretty_assertions::assert_eq!(expected, state);
}