Files
r701/tests/e2e.rs
T
nicolabellutiandClaude Sonnet 5 9977db0e46
Check, format and test / build (push) Successful in 47s
Added an e2e test harness with a fake R701 device
tests/mock/mod.rs emulates the device's TCP protocol (ping, get_name,
get_total_record_count, get_record_bytes), grounded in the reverse
engineering notes at
https://nicolabelluti.me/posts/2024/05/studying-a-communication-protocol/,
so tests/e2e.rs can exercise the real R701 client against it instead of
needing a physical reader. Starts with one test (connect + ping);
more scenarios (get_name, record streaming, error cases) to follow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-04 14:47:29 +02:00

15 lines
300 B
Rust

//! End-to-end tests exercising R701's public API against the emulated
//! device in `mock`.
#![allow(clippy::unwrap_used)]
mod mock;
use r701::R701;
#[tokio::test]
async fn connects_and_pings_successfully() {
let addr = mock::spawn().await;
assert!(R701::connect(addr).await.is_ok());
}