Documentation
¶
Overview ¶
Package test is the shared black-box test harness for the default command modules: it builds an editor with all defaults registered and runs commands resolved from the keymaps, so each module's tests can live beside the module while exercising the fully assembled registry
Index ¶
- func Char(ch rune) command.KeyEvent
- func CursorLine(t *testing.T, e *view.Editor) int
- func DocText(t *testing.T, e *view.Editor) string
- func Env(t *testing.T, text string) (*view.Editor, *command.Keymaps)
- func EnvWithRegistry(t *testing.T, text string) (*view.Editor, *command.Keymaps, *command.Registry)
- func MustFocusedView(t *testing.T, e *view.Editor) *view.View
- func RunCmd(t *testing.T, km *command.Keymaps, e *view.Editor, name string) command.Result
- func RunCmdArgs(t *testing.T, km *command.Keymaps, e *view.Editor, name, input string) command.Result
- func Special(s command.Special) command.KeyEvent
- func TwoBufferEnv(t *testing.T) (*view.Editor, *command.Keymaps)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CursorLine ¶
CursorLine returns the focused document's primary cursor line
func Env ¶
Env builds an editor with all default commands registered, seeded with text. Commands resolved from the keymaps operate on the returned editor
func EnvWithRegistry ¶
func EnvWithRegistry(t *testing.T, text string) ( *view.Editor, *command.Keymaps, *command.Registry, )
EnvWithRegistry builds the same env as Env but also returns the registry so tests can call ApplyTOML to exercise section Apply funcs
func MustFocusedView ¶
MustFocusedView returns the focused view, failing the test if there is none
func RunCmd ¶
RunCmd resolves a command by name and runs it against the editor. The default command wrappers ignore the Args, so nil is passed
func RunCmdArgs ¶
func RunCmdArgs( t *testing.T, km *command.Keymaps, e *view.Editor, name, input string, ) command.Result
RunCmdArgs resolves a command and runs it with positional args parsed from input against the command's own signature
Types ¶
This section is empty.