Add testing implementation for Drop for FileLockEntry

This commit is contained in:
Matthias Beyer 2016-10-07 18:46:50 +02:00
parent d375a6d2c6
commit 7b11e7dabb

View file

@ -879,6 +879,7 @@ impl<'a> DerefMut for FileLockEntry<'a> {
} }
} }
#[cfg(not(test))]
impl<'a> Drop for FileLockEntry<'a> { impl<'a> Drop for FileLockEntry<'a> {
/// This will silently ignore errors, use `Store::update` if you want to catch the errors /// This will silently ignore errors, use `Store::update` if you want to catch the errors
fn drop(&mut self) { fn drop(&mut self) {
@ -886,6 +887,15 @@ impl<'a> Drop for FileLockEntry<'a> {
} }
} }
#[cfg(test)]
impl<'a> Drop for FileLockEntry<'a> {
/// This will not silently ignore errors but prints the result of the _update() call for testing
fn drop(&mut self) {
println!("Drop Result: {:?}", self.store._update(self));
}
}
/// `EntryContent` type /// `EntryContent` type
pub type EntryContent = String; pub type EntryContent = String;