wip: more tests!

This commit is contained in:
Jonathan Kelley committed 2022-11-22 21:32:26 -08:00
1 parent 662f58c8bc
commit 9c4abcbea0
10 files changed
+203 -26

No files matched your search

+19
View File
@@ -15,6 +15,25 @@ impl<'a> Mutations<'a> {
template_mutations: Vec::new(),
}
}
/// A useful tool for testing mutations
///
/// Rewrites IDs to just be "template", so you can compare the mutations
pub fn santize(mut self) -> Self {
for edit in self
.template_mutations
.iter_mut()
.chain(self.edits.iter_mut())
{
match edit {
Mutation::LoadTemplate { name, .. } => *name = "template",
Mutation::SaveTemplate { name, .. } => *name = "template",
_ => {}
}
}
self
}
}
impl<'a> std::ops::Deref for Mutations<'a> {