diff --git a/src/tests/main_tests.rs b/src/tests/main_tests.rs index 53e8ebb..ae383da 100644 --- a/src/tests/main_tests.rs +++ b/src/tests/main_tests.rs @@ -11,4 +11,16 @@ fn it_works() { fn can_make_socket_listener(){ let listener = make_listener(String::from("localhost:5000")); drop(listener); -} \ No newline at end of file +} + +#[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); +} +