test: improve test coverage (#358)

* test(ntex-util): incrase time module coverage

* test(middleware): increase coverage in defaultheaders

* test(middleware/compress): improve test coverage
This commit is contained in:
msga-mmm 2024-05-13 03:41:26 -05:00 committed by GitHub
parent 55dcad5f27
commit d8f55decb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 90 additions and 0 deletions

View file

@ -454,6 +454,13 @@ mod tests {
dl.reset(Millis::ZERO);
assert!(lazy(|cx| dl.poll_elapsed(cx)).await.is_pending());
let mut dl = deadline(Millis(1));
dl.reset(Millis(100));
let first_time = now();
dl.await;
let second_time = now();
assert!(second_time - first_time >= time::Duration::from_millis(100));
let mut dl = deadline(Millis(0));
assert!(dl.is_elapsed());
dl.reset(Millis(1));