added connection test.

This commit is contained in:
Nickiel12 2021-12-17 12:49:27 -08:00
parent 264b496ef2
commit 31b628cb01

View file

@ -11,4 +11,16 @@ fn it_works() {
fn can_make_socket_listener(){
let listener = make_listener(String::from("localhost:5000"));
drop(listener);
}
}
#[test]
fn create_and_connect_to_listener() {
let listener = make_listener(String::from("localhost:5000"));
let join_handle = std::thread::spawn(move || {
let _outgoing = std::net::TcpStream::connect("localhost:5000").unwrap();
});
join_handle.join().unwrap();
drop(listener);
}