1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 06:57:53 +01:00

Add a small test for FakeStore

This commit is contained in:
Roman Zeyde 2018-09-01 10:13:46 +03:00
parent fff0d0632a
commit fcd85e9f51
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -16,3 +16,21 @@ impl WriteStore for FakeStore {
fn write(&self, _rows: Vec<Row>) {}
fn flush(&self) {}
}
#[cfg(test)]
mod tests {
#[test]
fn test_fakestore() {
use fake;
use store::{ReadStore, Row, WriteStore};
let store = fake::FakeStore {};
store.write(vec![Row {
key: b"k".to_vec(),
value: b"v".to_vec(),
}]);
store.flush();
assert!(store.get(b"").is_none());
assert!(store.scan(b"").is_empty());
}
}