test(client): add unit tests and integration test for alknet-client

- AlknetClient construction tests: new(), Default, Send+Sync, Debug
- ClientDialError tests: #[from] conversion, display formatting, Send+Sync
- dial_quic error path tests: NoTransport, TlsConfig on invalid creds
- dial_tcp_tls error path tests: NoTransport
- dial_iroh error path tests: NoTransport, extract_iroh_endpoint_id
- SOCKS5 proxy error display test (feature-gated)
- Integration test: dial_and_takeover.rs

Task: client/tests
This commit is contained in:
deepseek-v4-pro committed 2026-07-17 12:47:40 +00:00
1 parent 82ee37e206
commit 759c627ca4
6 files changed
+206

No files matched your search

@@ -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<T: Send + Sync>() {}
assert_send_sync::<AlknetClient>();
}
#[test]
fn client_dial_error_is_send_sync() {
use alknet_client::ClientDialError;
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<ClientDialError>();
}