mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
use short var name
This commit is contained in:
parent
c212620bc8
commit
6a3915a3f5
1 changed files with 7 additions and 7 deletions
14
src/index.rs
14
src/index.rs
|
|
@ -86,16 +86,16 @@ fn test() {
|
||||||
use std::{thread::sleep, time::Duration};
|
use std::{thread::sleep, time::Duration};
|
||||||
|
|
||||||
// test values auto-clean by timeout
|
// 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));
|
sleep(Duration::from_secs(1));
|
||||||
index.insert("h2".to_string(), 0, None, None);
|
i.insert("h2".to_string(), 0, None, None);
|
||||||
|
|
||||||
index.refresh();
|
i.refresh();
|
||||||
assert_eq!(index.len(), 2);
|
assert_eq!(i.len(), 2);
|
||||||
|
|
||||||
sleep(Duration::from_secs(2));
|
sleep(Duration::from_secs(2));
|
||||||
index.refresh();
|
i.refresh();
|
||||||
assert_eq!(index.len(), 1);
|
assert_eq!(i.len(), 1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue