Documentation
¶
Index ¶
- Constants
- func AssertAltScreen(t *testing.T, snap vttest.Snapshot, active bool)
- func AssertCursorPosition(t *testing.T, snap vttest.Snapshot, x, y int)
- func AssertCursorVisible(t *testing.T, snap vttest.Snapshot, visible bool)
- func AssertDimensions(t *testing.T, snap vttest.Snapshot, cols, rows int)
- func AssertTitle(t *testing.T, snap vttest.Snapshot, title string)
- func ContainsText(snap vttest.Snapshot, text string) bool
- func CrushBinary() string
- func NewIsolatedTerminal(t *testing.T, cols, rows int) *vttest.Terminal
- func NewIsolatedTerminalWithConfig(t *testing.T, cols, rows int, configJSON string) *vttest.Terminal
- func NewIsolatedTerminalWithConfigAndEnv(t *testing.T, cols, rows int, configJSON string, tmpDir string) *vttest.Terminal
- func NewTestTerminal(t *testing.T, args []string, cols, rows int) *vttest.Terminal
- func RequireSnapshot(t *testing.T, term *vttest.Terminal, name string)
- func RequireTextSnapshot(t *testing.T, term *vttest.Terminal, name string)
- func SkipIfE2EDisabled(t *testing.T)
- func SnapshotText(snap vttest.Snapshot) string
- func TestConfigJSON() string
- func WaitForCondition(t *testing.T, term *vttest.Terminal, condition func(vttest.Snapshot) bool, ...) bool
- func WaitForText(t *testing.T, term *vttest.Terminal, text string, timeout time.Duration) bool
Constants ¶
const ( StartupDelay = 3 * time.Second DialogTransition = 500 * time.Millisecond )
Timing constants for tests.
Variables ¶
This section is empty.
Functions ¶
func AssertAltScreen ¶
AssertAltScreen checks if alternate screen is active.
func AssertCursorPosition ¶
AssertCursorPosition checks the cursor is at the expected position.
func AssertCursorVisible ¶
AssertCursorVisible checks the cursor visibility.
func AssertDimensions ¶
AssertDimensions checks the terminal dimensions.
func AssertTitle ¶
AssertTitle checks the terminal title.
func ContainsText ¶
ContainsText checks if the terminal output contains the given text.
func CrushBinary ¶
func CrushBinary() string
CrushBinary returns the path to the crush binary. Checks CRUSH_BINARY env var first, then falls back to ../dist/crush.
func NewIsolatedTerminal ¶
NewIsolatedTerminal creates a terminal with isolated config environment. Uses the default TestConfigJSON for configuration.
func NewIsolatedTerminalWithConfig ¶
func NewIsolatedTerminalWithConfig(t *testing.T, cols, rows int, configJSON string) *vttest.Terminal
NewIsolatedTerminalWithConfig creates a terminal with isolated config environment using the provided config JSON string.
func NewIsolatedTerminalWithConfigAndEnv ¶
func NewIsolatedTerminalWithConfigAndEnv(t *testing.T, cols, rows int, configJSON string, tmpDir string) *vttest.Terminal
NewIsolatedTerminalWithConfigAndEnv creates a terminal with isolated config environment using the provided config JSON string and a pre-created tmpDir for full control over the environment (e.g., for creating agent files before starting).
func NewTestTerminal ¶
NewTestTerminal creates a new terminal running the crush binary with given args.
func RequireSnapshot ¶
RequireSnapshot compares the terminal state against a golden JSON snapshot. Use -update flag to regenerate snapshots.
func RequireTextSnapshot ¶
RequireTextSnapshot compares just the text content against a golden file. This is more lenient than full snapshot comparison - ignores colors/styles.
func SkipIfE2EDisabled ¶
SkipIfE2EDisabled skips the test if E2E_SKIP is set.
func SnapshotText ¶
SnapshotText returns the text content of the terminal snapshot.
func TestConfigJSON ¶
func TestConfigJSON() string
TestConfigJSON returns the config JSON for isolated test environments.
Types ¶
This section is empty.