test

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(t *testing.T, actual interface{}, expected interface{})

Equals is a testing helper does a deep comparison of passed in interfaces and fails test if they are not equal.

func Ok

func Ok(t *testing.T, err error)

Ok is a testing helper that will fail the test if err does not equal nil.

func ReadFileAsBytes

func ReadFileAsBytes(t *testing.T, path ...string) []byte

ReadFileAsBytes is a testing helper, that returns the file if possible. If there is an error, it will call t.Fatal(), ending the test.

func ReadFileAsString

func ReadFileAsString(t *testing.T, path ...string) string

ReadFileAsString is a testing helper, that returns the file if possible. If there is an error, it will call t.Fatal(), ending the test.

Example:

content := test.ReadFileAsString(t, "folderA", "folderB", "file.txt")

Types

This section is empty.

Jump to

Keyboard shortcuts

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