use short var name

This commit is contained in:
yggverse 2025-07-07 18:43:25 +03:00
parent c212620bc8
commit 6a3915a3f5

View file

@ -86,16 +86,16 @@ fn test() {
use std::{thread::sleep, time::Duration};
// test values auto-clean by timeout
let mut index = Index::init(2, Some(3), false, false);
let mut i = Index::init(2, Some(3), false, false);
index.insert("h1".to_string(), 0, None, None);
i.insert("h1".to_string(), 0, None, None);
sleep(Duration::from_secs(1));
index.insert("h2".to_string(), 0, None, None);
i.insert("h2".to_string(), 0, None, None);
index.refresh();
assert_eq!(index.len(), 2);
i.refresh();
assert_eq!(i.len(), 2);
sleep(Duration::from_secs(2));
index.refresh();
assert_eq!(index.len(), 1);
i.refresh();
assert_eq!(i.len(), 1)
}