testutils

package
v0.36.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testutils holds helpers shared by the tests of several ux packages.

Test-only, and imported from _test.go files alone. StripANSI is the one that matters: the panels are tested with a colour profile forced on, so nearly every assertion needs the text without the styling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLoader added in v0.36.4

func ApplyLoader(opts *codescan.Options) *codescan.Options

ApplyLoader writes the loader this run was asked for onto opts, and returns it for chaining.

The TUI scans through the same library as everything else, so its tests answer to the same run-wide setting; see internal/testloader for what selects it and why.

A test that pins a loader must not route through here - there is no telling a field left at its zero value from one set on purpose - which is why this refuses one rather than writing over it.

func KeyRune

func KeyRune(r rune) tea.KeyMsg

func StripANSI

func StripANSI(s string) string

StripANSI removes the SGR escape sequences lipgloss emits.

Assertions can then look at the text a user reads, rather than at the styling around it.

func WriteTempGo

func WriteTempGo(t *testing.T, content string) string

WriteTempGo puts a Go file on disk and returns its path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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