Raxol.Test.EmulatorHelpers (Raxol v0.5.0)

View Source

Helper functions for Emulator tests.

Summary

Functions

Fills a region of the emulator buffer with identifiable line text.

Retrieves the text content of a specific line from the emulator's active buffer. Replaces nil chars with spaces.

Unwraps {:ok, value}, {:error, _, value}, or returns value if already a struct. Useful for safely extracting emulator or buffer structs from handler results.

Functions

fill_buffer(emulator, start_line, end_line)

Fills a region of the emulator buffer with identifiable line text.

get_line_text(emulator, line_index)

Retrieves the text content of a specific line from the emulator's active buffer. Replaces nil chars with spaces.

unwrap_ok(value)

Unwraps {:ok, value}, {:error, _, value}, or returns value if already a struct. Useful for safely extracting emulator or buffer structs from handler results.