The analysis and storage now contain two different heatmaps for the CT and T sides respectively. However on the frontend I currently just have them all listed out with the side as a prefix, which is not very useful and we should more change the data structure to essentially send the two heatmaps for a player as a single data structure and then in the view display them side by side. However I am not 100% how to best achieve this
42 lines
1.1 KiB
Rust
42 lines
1.1 KiB
Rust
use analysis::heatmap;
|
|
use tracing_test::traced_test;
|
|
|
|
#[test]
|
|
#[traced_test]
|
|
fn heatmap_nuke() {
|
|
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../testfiles/nuke.dem");
|
|
dbg!(path);
|
|
let input_bytes = std::fs::read(path).unwrap();
|
|
|
|
let config = heatmap::Config { cell_size: 5.0 };
|
|
let result = heatmap::parse(&config, &input_bytes).unwrap();
|
|
|
|
assert_eq!(result.player_heatmaps.len(), 20);
|
|
}
|
|
|
|
#[test]
|
|
#[traced_test]
|
|
fn heatmap_inferno() {
|
|
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../testfiles/inferno.dem");
|
|
dbg!(path);
|
|
let input_bytes = std::fs::read(path).unwrap();
|
|
|
|
let config = heatmap::Config { cell_size: 5.0 };
|
|
let result = heatmap::parse(&config, &input_bytes).unwrap();
|
|
|
|
assert_eq!(result.player_heatmaps.len(), 20);
|
|
}
|
|
|
|
#[test]
|
|
#[traced_test]
|
|
fn heatmap_dust2() {
|
|
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../testfiles/dust2.dem");
|
|
dbg!(path);
|
|
let input_bytes = std::fs::read(path).unwrap();
|
|
|
|
let config = heatmap::Config { cell_size: 5.0 };
|
|
let result = heatmap::parse(&config, &input_bytes).unwrap();
|
|
|
|
assert_eq!(result.player_heatmaps.len(), 20);
|
|
}
|