feat: introduce macro for testing snap files across platforms

This commit is contained in:
Simon Brugman 2023-01-25 23:34:05 +01:00 committed by Charlie Marsh
parent 16d2ece87d
commit 413acdf83c
5 changed files with 139 additions and 3 deletions

View file

@ -40,7 +40,7 @@ mod tests {
use crate::registry::Rule;
use crate::linter::test_path;
use crate::settings;
use crate::{assert_yaml_snapshot, settings};
fn rules(rule_code: Rule, path: &Path) -> Result<()> {
let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy());
@ -50,7 +50,7 @@ mod tests {
.as_path(),
&settings::Settings::for_rule(rule_code),
)?;
insta::assert_yaml_snapshot!(snapshot, diagnostics);
assert_yaml_snapshot!(snapshot, diagnostics);
Ok(())
}
}