Fix test: Check whether in cache, then get, then check again
After moving an entry, the entry should _not_ be in the cache. This is just a decision that has to be made, whether we cache the moved entry or not. I decided to not cache because it is results in less code. After that check, we get the entry from the backend and then we can check whether the entry is in the cache, which is then should be. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
583f972788
commit
7348378a96
1 changed files with 3 additions and 1 deletions
|
@ -1212,7 +1212,9 @@ mod store_tests {
|
|||
assert!(r.map_err(|e| debug!("ERROR: {:?}", e)).is_ok());
|
||||
|
||||
{
|
||||
assert!(store.entries.read().unwrap().get(&id_mv).is_some());
|
||||
assert!(store.entries.read().unwrap().get(&id_mv).is_none()); // entry not in cache yet
|
||||
assert!(store.get(id_mv.clone()).unwrap().is_some()); // get entry from backend
|
||||
assert!(store.entries.read().unwrap().get(&id_mv).is_some()); // entry in cache
|
||||
}
|
||||
|
||||
let res = store.get(id.clone());
|
||||
|
|
Loading…
Reference in a new issue