diff --git a/crates/alknet-client/src/client.rs b/crates/alknet-client/src/client.rs index bafd213..86f3b2f 100644 --- a/crates/alknet-client/src/client.rs +++ b/crates/alknet-client/src/client.rs @@ -122,3 +122,33 @@ impl fmt::Debug for AlknetClient { .finish() } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn new_creates_empty_client() { + let client = AlknetClient::new(); + let debug = format!("{:?}", client); + assert!(debug.contains("AlknetClient")); + } + + #[test] + fn default_delegates_to_new() { + let _client = AlknetClient::default(); + } + + #[test] + fn alknet_client_is_send_sync() { + fn assert_send_sync() {} + assert_send_sync::(); + } + + #[test] + fn debug_lists_configured_transports() { + let client = AlknetClient::new(); + let debug = format!("{:?}", client); + assert!(!debug.is_empty()); + } +} diff --git a/crates/alknet-client/src/dial/iroh.rs b/crates/alknet-client/src/dial/iroh.rs index 1b4a838..09ff8b3 100644 --- a/crates/alknet-client/src/dial/iroh.rs +++ b/crates/alknet-client/src/dial/iroh.rs @@ -83,3 +83,45 @@ fn extract_iroh_endpoint_id(fingerprint: &str) -> Result() {} + assert_send_sync::(); + } +} diff --git a/crates/alknet-client/tests/dial_and_takeover.rs b/crates/alknet-client/tests/dial_and_takeover.rs new file mode 100644 index 0000000..06dedc3 --- /dev/null +++ b/crates/alknet-client/tests/dial_and_takeover.rs @@ -0,0 +1,28 @@ +//! Integration test: dial + take-over composition. +//! +//! Verifies that the AlknetClient type exists and compiles correctly. +//! Full end-to-end dial tests (with a real quinn endpoint) are tested +//! in the assembly layer integration tests (future hub/worker tests). + +use alknet_client::AlknetClient; +use alknet_core::credentials::ConnectionCredentials; + +#[tokio::test] +async fn alknet_client_new_creates_empty_client() { + let client = AlknetClient::new(); + let creds = ConnectionCredentials::new(); + let _ = (client, creds); +} + +#[test] +fn alknet_client_is_send_sync() { + fn assert_send_sync() {} + assert_send_sync::(); +} + +#[test] +fn client_dial_error_is_send_sync() { + use alknet_client::ClientDialError; + fn assert_send_sync() {} + assert_send_sync::(); +}