Documentation
¶
Overview ¶
Package visualtest captures the screen produced by an example program.
It composes programtest's in-process host with ptytest's renderer-sized screen model. The first drives the real program loop and captures its frame bytes; the second answers what those bytes leave in terminal cells. Keeping that composition here gives examples one visual assertion path instead of a private screen model in every command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Match ¶
Match compares the visible part of rows with the golden file at path. Running the example module's tests with -update replaces the file with the captured result.
Trailing spaces and blank rows carry no visible information and are removed. Spaces inside a row and empty rows between content remain significant.
Types ¶
type Capture ¶
Capture is one completely repainted program screen and the renderer bytes that produced that repaint.
type Config ¶
Config is the complete initial state of a visual-test Host. Width and Height must be positive terminal-cell dimensions. The zero Ground models an unknown terminal background.
type Host ¶
type Host struct {
*programtest.Host
// contains filtered or unexported fields
}
Host is a programtest host that also reports the terminal colours an example is being checked against. No other optional capability is invented.