componenttest

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 2 Imported by: ? 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 componenttest runs components without a compositor: a Loop that queues invoked work until the test drives it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loop

type Loop struct {
	// contains filtered or unexported fields
}

Loop is a component.Loop driven by hand. Invoke queues work from any goroutine; Pass and Settle run it on the calling goroutine.

func (*Loop) Invoke

func (l *Loop) Invoke(fn func())

Invoke queues fn for the next pass. After Stop it is dropped.

func (*Loop) OnStop

func (l *Loop) OnStop(fn func()) (cancel func())

OnStop registers fn to run at Stop, in reverse registration order. After Stop it runs at once.

func (*Loop) Pass

func (l *Loop) Pass() int

Pass runs the work queued so far, like one loop pass: work queued while it runs waits for the next pass. It reports how much ran.

func (*Loop) Settle

func (l *Loop) Settle()

Settle runs passes until no work is queued.

func (*Loop) Stop

func (l *Loop) Stop()

Stop ends the loop: queued work is dropped, stop hooks run, and later Invokes are dropped.

Jump to

Keyboard shortcuts

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