Skip to main content

Crate reovim_testing

Crate reovim_testing 

Source
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§

IntegrationTest
Integration test builder.
MultiClientPresenceTest
Multi-client test with automatic presence join/leave.
MultiClientTest
Multi-client test builder.
PresenceTestClient
Presence-aware test client wrapper.
RegisterInfo
Register information from debug endpoint.
StateSnapshot
State snapshot captured after a key.
StepTest
Step-by-step test builder.
StepTrace
Trace of step-by-step execution.
TestClient
Client wrapper for multi-client tests.
TestResult
Test result with assertion methods.
TestServerHarness
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.