testhelper

package
v0.6.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdout

func CaptureStdout(f func()) string

Capture the output of the go program while running function f

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

func DisableTestMode

func DisableTestMode()

Disable test mode behavior again

Optional after testing has been done

func EnableTestMode

func EnableTestMode()

Enable 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

Execute 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