//! The socket the server listens on is configurable through `FROGUE_BIND_ADDR`.
//!
//! These tests spawn the real `frogue` binary rather than a parsing helper, so
//! they cover the wiring in `main`: the variable must actually reach the
//! listener, and a value that is not a socket address must fail the startup
//! instead of falling back to the default silently.
mod support;
use support::{Server, free_port};
#[test]
fn honours_frogue_bind_addr() {
let port = free_port();
let mut server = Server::spawn(&format!("127.0.0.1:{port}"));
server.wait_for_connection(port);
}
#[test]
fn rejects_a_bind_addr_that_is_not_a_socket_address() {
let mut server = Server::spawn("this-is-not-a-socket-address");
let status = server.wait_for_exit();
assert!(
!status.success(),
"frogue should fail fast on an unparsable FROGUE_BIND_ADDR, got {status}"
);
}