testutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqualDir added in v1.0.1

func AssertEqualDir(t testing.TB, expected, actual string, opts ...EqualDirOpt)

AssertEqualDir compares expected an actual directories (and their subdirectories).

It will fail with t in case a file is missing in actual, a file is present in actual but not in expected and if the content of any file in actual is not the same as its peer in expected.

func GetTestdata

func GetTestdata(parents ...string) string

GetTestdata returns the path of 'testdata' folder.

Input parameters parents is a list of ".." for the relative _test.go file being executed.

Types

type EqualDirOpt added in v1.0.1

type EqualDirOpt func(e *equalDirClient)

EqualDirOpt represents an option to be given to AssertEqualDir to tune its behavior.

func WithIgnoreDiff added in v1.0.1

func WithIgnoreDiff(ignore IgnoreFunc) EqualDirOpt

WithIgnoreDiff is an option to give to AssertEqualDir to ignore specific differences during execution.

type IgnoreFunc added in v1.0.1

type IgnoreFunc func(filename string, item diffmatchpatch.Diff) bool

IgnoreFunc represents a function to be given with WithIgnoreDiff to ignore a specific difference in AssertEqualDir.

Jump to

Keyboard shortcuts

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