mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
More tests (#368)
This commit is contained in:
parent
34142e1ae2
commit
e0b5284fdd
9 changed files with 82 additions and 37 deletions
|
@ -726,6 +726,7 @@ mod tests {
|
|||
|
||||
#[ntex::test]
|
||||
async fn test_basic() {
|
||||
let _ = env_logger::try_init();
|
||||
let (client, server) = IoTest::create();
|
||||
client.remote_buffer_cap(1024);
|
||||
client.write("GET /test HTTP/1\r\n\r\n");
|
||||
|
|
|
@ -685,5 +685,11 @@ mod tests {
|
|||
|
||||
let res = lazy(|cx| server2.poll_write_buf(cx, b"123")).await;
|
||||
assert!(res.is_pending());
|
||||
|
||||
let (client, _) = IoTest::create();
|
||||
let addr: net::SocketAddr = "127.0.0.1:8080".parse().unwrap();
|
||||
let client = crate::Io::new(client.set_peer_addr(addr));
|
||||
let item = client.query::<crate::types::PeerAddr>();
|
||||
assert!(format!("{:?}", item).contains("QueryItem(127.0.0.1:8080)"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue