hugo: github.com/gohugoio/hugo/htesting Index | Files | Directories

package htesting

import "github.com/gohugoio/hugo/htesting"

Index

Package Files

test_helpers.go testdata_builder.go

func BailOut Uses

func BailOut(after time.Duration)

BailOut panics with a stack trace after the given duration. Useful for hanging tests.

func CreateTempDir Uses

func CreateTempDir(fs afero.Fs, prefix string) (string, func(), error)

CreateTempDir creates a temp dir in the given filesystem and returns the dirnam and a func that removes it when done.

func DiffStringSlices Uses

func DiffStringSlices(slice1 []string, slice2 []string) []string

DiffStringSlices returns the difference between two string slices. Useful in tests. See: http://stackoverflow.com/questions/19374219/how-to-find-the-difference-between-two-slices-of-strings-in-golang

func DiffStrings Uses

func DiffStrings(s1, s2 string) []string

DiffStrings splits the strings into fields and runs it into DiffStringSlices. Useful for tests.

func NewTestdataBuilder Uses

func NewTestdataBuilder(fs afero.Fs, workingDir string, t testing.TB) *testdataBuilder

func RandIntn Uses

func RandIntn(n int) int

Directories

PathSynopsis
hqt

Package htesting imports 7 packages (graph) and is imported by 8 packages. Updated 2020-05-24. Refresh now. Tools for package owners.