Use central snapshot folder for each package

This commit is contained in:
Lutetium-Vanadium 2021-06-19 14:25:15 +05:30
parent 270b9be936
commit 08d2e1649b
53 changed files with 8 additions and 3 deletions

2
.fdignore Normal file
View File

@ -0,0 +1,2 @@
*.snap
*.snap.new

View File

@ -186,7 +186,9 @@ impl TestBackend {
ops::Bound::Unbounded => self.cells.len(),
};
self.cells[start..end].fill_with(Cell::default);
self.cells[start..end]
.iter_mut()
.for_each(|c| *c = Cell::default());
}
fn put_char(&mut self, c: char) {

View File

@ -78,13 +78,14 @@ macro_rules! assert_backend_snapshot {
$crate::assert_backend_snapshot!(@__impl ::insta::assert_display_snapshot!($value))
};
(@__impl $($tt:tt)*) => {
(@__impl $($tt:tt)*) => {{
::insta::with_settings!({
snapshot_path => $crate::features::SNAPSHOT_PATH
snapshot_path => ::std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join($crate::features::SNAPSHOT_PATH)
}, {
$($tt)*
})
}
}
}
#[cfg(test)]