testhelper

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testhelper is used in testing. Don't use this package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdout

func CaptureStdout(f func()) string

CaptureStdout captures the output of the go program while running function f

Source https://gist.github.com/mindscratch/0faa78bd3c0005d080bf

func DisableTestMode

func DisableTestMode()

DisableTestMode disables test mode behavior again

Optional after testing has been done

func EnableTestMode

func EnableTestMode()

EnableTestMode enables test mode by disabling the default exit behavior, so go test won't fail with plugin states

func RunMainTest

func RunMainTest(f func(), args ...string) string

RunMainTest executes main function from a main package, while capturing its stdout

You will need to pass `main`, since the function won't have access to the package's namespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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