Documentation ¶
Overview ¶
Package controltest provides a controller for use in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
*control.Controller
}
Controller embeds a control.Controller. It overrides the Query method, to return queries that require Done to be called. It accomplishes this by associating a finalizer with the Query that panics, and then clears the finalizer when Done is called.
This approach is not foolproof: it is possible that garbage collection may not run during a test, and therefore the finalizer will not be invoked.
func New ¶
func New(c *control.Controller) *Controller
New returns a new Controller encapsulating c.
Click to show internal directories.
Click to hide internal directories.