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:
parent
fff0d0632a
commit
fcd85e9f51
1 changed files with 18 additions and 0 deletions
18
src/fake.rs
18
src/fake.rs
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue