Skip to main content

Module testing

Module testing 

Source
Expand description

Test utilities for kernel-level testing.

Provides shared helpers used by all modules and drivers that need a real in-memory BufferManager for testing. This eliminates the need to duplicate TestBufferManager and create_test_context() across 30+ test modules.

§Usage

use reovim_kernel::testing::{create_test_context, setup_buffer};

let ctx = create_test_context();
let buffer_id = setup_buffer(&ctx, "hello world");

§Architecture

This module is unconditionally compiled (not #[cfg(test)]) so that downstream crates can use it in their test modules. This follows the same pattern as reovim_driver_session::testing.

Structs§

TestBufferManager
In-memory buffer manager for testing.

Functions§

create_test_context
Create a KernelContext with a real in-memory buffer manager.
setup_buffer
Create a buffer with content and register it in the context.
test_mode
Standard test mode ID for unit tests.