Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestBackend

type TestBackend struct {
	Mouse     mathi.Vec2
	Pressed   bool
	Input     timui.Input
	Clipboard string
	// contains filtered or unexported fields
}

TestBackend accumulates the pushed cell diffs like a real terminal, so after any Finish its grid equals that frame's front buffer.

func New

func New(t *testing.T, width, height int) (*timui.Timui, *TestBackend)

func (*TestBackend) CheckSnapshot

func (b *TestBackend) CheckSnapshot(path string)

func (*TestBackend) MousePosition

func (b *TestBackend) MousePosition() mathi.Vec2

func (*TestBackend) MousePressed

func (b *TestBackend) MousePressed(key timui.Key) bool

func (*TestBackend) Render

func (b *TestBackend) Render()

func (*TestBackend) Set

func (b *TestBackend) Set(pos mathi.Vec2, char rune, fg, bg uint32)

func (*TestBackend) Size

func (b *TestBackend) Size() mathi.Vec2

func (*TestBackend) String

func (b *TestBackend) String() string

String frames the screen so snapshot files keep their trailing spaces even through editors that trim whitespace.

func (*TestBackend) TakeInput

func (b *TestBackend) TakeInput() timui.Input

func (*TestBackend) WriteClipboard added in v0.0.4

func (b *TestBackend) WriteClipboard(text string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL