cleanup
This commit is contained in:
parent
ff99fce62b
commit
443685018f
@ -489,7 +489,7 @@ mod test {
|
||||
.await;
|
||||
}
|
||||
|
||||
for _i in 0..10 {
|
||||
for _ in 0..10 {
|
||||
ctx.update_blocklist(&mut IpData {
|
||||
ip: "1.1.1.2".to_string(),
|
||||
hostname: "test2".to_string(),
|
||||
@ -541,7 +541,8 @@ mod test {
|
||||
|
||||
let pending = ctx.get_blocklist_pending().await;
|
||||
assert_eq!(pending.len(), 4);
|
||||
for i in ["1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4"] {
|
||||
let ips = ["1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4"];
|
||||
for i in ips {
|
||||
let ip = ctx
|
||||
.blocklist
|
||||
.get(&i.to_string())
|
||||
@ -565,11 +566,10 @@ mod test {
|
||||
let mut ctx = prepare_test_data().await;
|
||||
let after_gc = ctx.gc_blocklist().await;
|
||||
assert_eq!(after_gc.len(), 2);
|
||||
for i in &["1.1.1.3", "1.1.1.4"] {
|
||||
assert_eq!(
|
||||
ctx.blocklist.get(&i.to_string()).unwrap().ipdata.ip,
|
||||
i.to_string()
|
||||
);
|
||||
let ips = &["1.1.1.3", "1.1.1.4"];
|
||||
for ip in ips {
|
||||
let ipstring = ip.to_string();
|
||||
assert_eq!(ctx.blocklist.get(&ipstring).unwrap().ipdata.ip, ipstring);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ pub fn _dedup<T: Ord + PartialOrd>(list: &mut Vec<T>) -> usize {
|
||||
list.len()
|
||||
}
|
||||
|
||||
pub fn sleep_ms(ms: u64) {
|
||||
pub fn _sleep_ms(ms: u64) {
|
||||
std::thread::sleep(Duration::from_millis(ms));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user