test

package
v0.0.0-...-81a76c0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package test provides testing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assembles

func Assembles(t *testing.T, asm []byte)

Assembles asserts that the given assembly code passes the go assembler.

func Exec

func Exec(t *testing.T, name string, arg ...string)

Exec executes the named program with the given arguments, logging the command and output and failing the test on error.

func ExecCommand

func ExecCommand(t *testing.T, cmd *exec.Cmd)

ExecCommand executes the command, logging the command and output and failing the test on error.

func GoTool

func GoTool() string

GoTool returns a best guess path to the "go" binary.

func Logger

func Logger(tb testing.TB) *log.Logger

Logger builds a logger that writes to the test object.

func RequiresNetwork

func RequiresNetwork(t *testing.T)

RequiresNetwork declares that a test requires network access. The test is skipped if network access isn't enabled with the -net flag.

func TempDir

func TempDir(t *testing.T) (string, func())

TempDir creates a temp directory. Returns the path to the directory and a cleanup function.

func Writer

func Writer(tb testing.TB) io.Writer

Writer builds a writer that logs all writes to the test object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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