test

package
v0.0.1-0...-f17ebbc Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package test implements unit-testing helper functions.

Index

Constants

This section is empty.

Variables

View Source
var MockFiles = map[string]string{
	"alpha.extn": "Alpha.\n",
	"bravo.extn": "Bravo.\n",
}

MockFiles is a map of mock files for unit-testing.

Functions

func AssertErr

func AssertErr(t *testing.T, err error, regx string)

AssertErr asserts an error's message matches a regular expression.

func AssertFile

func AssertFile(t *testing.T, path, body string)

AssertFile asserts the contents of a file from a string.

func Dire

func Dire(t *testing.T) string

Dire returns a temporary directory populated from MockFiles.

func File

func File(t *testing.T, name string) string

File returns a temporary file populated from an entry in MockFiles.

Types

This section is empty.

Jump to

Keyboard shortcuts

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