LightMappedGeneric

This commit is contained in:
Robin Appelman 2023-12-18 19:17:34 +01:00
commit ab10e2d05c
14 changed files with 378 additions and 243 deletions

18
tests/parse.rs Normal file
View file

@ -0,0 +1,18 @@
use miette::{GraphicalReportHandler, GraphicalTheme};
use std::fs::read_to_string;
use test_case::test_case;
use vmt_parser::from_str;
#[test_case("tests/data/concretefloor003.vmt")]
fn test_serde(path: &str) {
let raw = read_to_string(path).unwrap();
match from_str(&raw) {
Ok(result) => insta::assert_ron_snapshot!(path, result),
Err(e) => {
let handler = GraphicalReportHandler::new_themed(GraphicalTheme::unicode_nocolor());
let mut out = String::new();
handler.render_report(&mut out, &e).unwrap();
insta::assert_snapshot!(path, out)
}
}
}