mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
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:
parent
55dcad5f27
commit
d8f55decb0
3 changed files with 90 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue