test: improve coverage (#231)

* feat(ntex-glommio): remove unused mut

* test(ntex-io): check Debug implementation for FilterServiceFactory

* chore: format code

* feat(ntex-util): check Debug and poll_ready for KeepAlive

* test(ntex-util): wait a bit until the poll is ready

* test(ntex-bytes): assert error for implementation try_from for BytesVec

* feat(ntex-tokio): remove unused mut

* feat(ntex-tls): use add_trust_anchors instead of add_server_trust_anchors

* chore: format code

* feat(ntex-util): check readiness after sleeping but before expiring

* feat(ntex-util): remove unnecessary assertion
This commit is contained in:
msga-mmm 2023-10-17 08:14:40 -05:00 committed by GitHub
parent bd49962d1b
commit 9bb4a60ad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 21 deletions

View file

@ -406,12 +406,6 @@ mod test {
s.clear();
assert_eq!(s, "");
assert!(ByteString::try_from(b"\xc3\x28".as_ref()).is_err());
assert!(ByteString::try_from(vec![b'\xc3']).is_err());
assert!(ByteString::try_from(Bytes::from_static(b"\xc3\x28")).is_err());
assert!(ByteString::try_from(&Bytes::from_static(b"\xc3\x28")).is_err());
assert!(ByteString::try_from(BytesMut::copy_from_slice(b"\xc3\x28")).is_err());
}
#[test]
@ -465,12 +459,23 @@ mod test {
#[test]
fn test_try_from() {
let _ = ByteString::try_from(&b"nice bytes"[..]).unwrap();
assert!(ByteString::try_from(b"\xc3\x28".as_ref()).is_err());
let _ = ByteString::try_from(b"nice bytes".to_vec()).unwrap();
assert!(ByteString::try_from(vec![b'\xc3']).is_err());
let _ = ByteString::try_from(Bytes::from_static(b"nice bytes")).unwrap();
assert!(ByteString::try_from(Bytes::from_static(b"\xc3\x28")).is_err());
let _ = ByteString::try_from(&Bytes::from_static(b"nice bytes")).unwrap();
assert!(ByteString::try_from(&Bytes::from_static(b"\xc3\x28")).is_err());
let _ = ByteString::try_from(BytesMut::from(&b"nice bytes"[..])).unwrap();
assert!(ByteString::try_from(BytesMut::copy_from_slice(b"\xc3\x28")).is_err());
let _ =
ByteString::try_from(BytesVec::copy_from_slice(&b"nice bytes"[..])).unwrap();
assert!(ByteString::try_from(BytesVec::copy_from_slice(b"\xc3\x28")).is_err());
}
#[test]