Expand description
Integration test harness for reovim.
This crate provides the mechanism layer for integration testing. Modules use this harness to define their test policy (what to test).
§Architecture (Mechanism vs Policy)
shared/testing/ ← MECHANISM (this crate)
├── harness.rs - Server process lifecycle
├── integration.rs - Single-client test builder
├── multi_client.rs - Multi-client test builder
├── step_test.rs - Per-key state tracking
└── assertions.rs - Assertion macros
server/modules/vim/tests/ ← POLICY (module-specific tests)
├── operators.rs - What operators to test
├── registers.rs - What register behaviors to verify
└── cursor_movement.rs - What cursor behaviors to verify§Protocol
This crate uses gRPC v2 for communicating with test servers. The legacy JSON-RPC v1 protocol is no longer supported.
§Example Usage (in module tests)
ⓘ
use reovim_testing::{IntegrationTest, TestResult};
#[tokio::test]
async fn test_dd_deletes_line() {
let result = IntegrationTest::new()
.await
.with_buffer("hello\nworld")
.send_keys("dd")
.run()
.await;
result.assert_buffer_eq("world");
}Modules§
- frame
- Frame capture assertion helpers for TUI E2E tests.
Macros§
- assert_
buffer_ eq - Assert buffer content equals expected.
- assert_
completes_ within - Assert operation completes within duration.
- assert_
cursor - Assert cursor position (line, col) - matches vim convention.
- assert_
mode - Assert current mode.
- assert_
register - Assert register content and type.
Structs§
- Integration
Test - Integration test builder.
- Multi
Client Presence Test - Multi-client test with automatic presence join/leave.
- Multi
Client Test - Multi-client test builder.
- Presence
Test Client - Presence-aware test client wrapper.
- Register
Info - Register information from debug endpoint.
- State
Snapshot - State snapshot captured after a key.
- Step
Test - Step-by-step test builder.
- Step
Trace - Trace of step-by-step execution.
- Test
Client - Client wrapper for multi-client tests.
- Test
Result - Test result with assertion methods.
- Test
Server Harness - Test harness that spawns a server process.
Functions§
- demo_
module_ filename - Get the filename for the demo module library.
- demo_
module_ path - Get the path to the demo module shared library.