added connection test.
This commit is contained in:
parent
264b496ef2
commit
31b628cb01
1 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue