lesavka/testing/tests/server_runtime_contract.rs

23 lines
949 B
Rust
Raw Permalink Normal View History

//! Integration coverage for public server runtime helpers.
//!
//! Scope: keep public helper smoke tests in the shared top-level testing
//! module rather than the server crate's local `tests/` folder.
//! Targets: `server/src/runtime_support.rs` public pure helpers.
//! Why: these helpers are part of a cross-crate contract surface and fit the
//! centralized testing layout better than package-scoped integration tests.
2026-04-10 14:05:04 -03:00
use lesavka_server::runtime_support::{next_stream_id, should_recover_hid_error};
2025-06-01 13:31:22 -05:00
2026-04-10 14:05:04 -03:00
#[test]
fn hid_runtime_helpers_compile_and_behave() {
assert!(should_recover_hid_error(Some(libc::ENOTCONN)));
assert!(should_recover_hid_error(Some(libc::ESHUTDOWN)));
assert!(should_recover_hid_error(Some(libc::EPIPE)));
assert!(!should_recover_hid_error(Some(libc::EAGAIN)));
assert!(!should_recover_hid_error(None));
let first = next_stream_id();
let second = next_stream_id();
assert!(second > first);
2025-06-01 13:31:22 -05:00
}