Expand description
Common test helpers and utilities for CLASP tests
This crate provides robust test utilities including:
- Condition-based waiting (no hardcoded sleeps)
- Proper resource cleanup with RAII
- Strong assertion helpers
- Test router management
- Value collectors for subscription testing
Structs§
- Test
Router - A test router that automatically cleans up on drop
- Value
Collector - Collector for subscription values with thread-safe access
Constants§
- DEFAULT_
CHECK_ INTERVAL - Default condition check interval
- DEFAULT_
TIMEOUT - Default test timeout
Functions§
- assert_
approx_ eq - Assert that two values are approximately equal (for floating point)
- assert_
err - Assert that a Result is Err
- assert_
ok - Assert that a Result is Ok and return the value
- assert_
some - Assert that an Option is Some and return the value
- assert_
that - Assert a condition with a custom message
- find_
available_ port - Find an available TCP port for testing
- find_
available_ udp_ port - Find an available UDP port for testing
- wait_
for - Wait for a condition with timeout - condition-based, not time-based
- wait_
for_ count - Wait for an atomic counter to reach a target value
- wait_
for_ flag - Wait for a boolean flag to become true
- wait_
with_ notify - Wait with notification - more efficient than polling