treetest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package treetest walks lys-ui widget trees for the shell's surface tests: find the button a user would click, read what the labels say.

Index

Constants

View Source
const Liveness = 10 * time.Second

Liveness is how long a surface harness waits for a surface to open or a request to be answered before failing: a guard against a hang, not a speed bound. The first surface of a test binary compiles the whole stylesheet bundle, which the race detector under a parallel test run stretches past a couple of seconds.

Variables

Loop stands in for the process's one UI goroutine in the surface harnesses: lys-ui keeps its style and layout scratch per process, so every harness in a test binary runs its widget work under this one lock, never a lock of its own (a finished test's harness can still be draining while the next one builds).

Functions

func All

func All[T widget.Widget](root widget.Widget) []T

All is every widget of type T under root, in walk order.

func Button

func Button(t *testing.T, root widget.Widget, name string) *widget.Button

Button is the first button whose accessible name is name.

func First

func First[T widget.Widget](t *testing.T, root widget.Widget) T

First is the first widget of type T under root.

func Font

func Font(t *testing.T) render.Font

Font is the Go Regular face the widget tests measure and paint text with.

func IconTheme

func IconTheme(t *testing.T, names ...string)

IconTheme points theme icon lookups at a temp hicolor theme holding one solid square SVG app icon per name, for the duration of the test.

func Ink

func Ink(w widget.Widget) int

Ink counts the pixels w paints when laid out at its natural size.

func Labels

func Labels(root widget.Widget) []string

Labels is the text of every label under root, in walk order.

func Walk

func Walk(w widget.Widget, visit func(widget.Widget))

Walk visits w and every descendant, depth first: a hidden revealer's content too, which its Children leave out.

func WithClass

func WithClass(root widget.Widget, class string) []widget.Widget

WithClass is every widget under root carrying class.

Types

This section is empty.

Jump to

Keyboard shortcuts

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