internal

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCompareOptions = CompareOptions{true, true, true, false, false, false}
)

Functions

func AsMultiLineYaml

func AsMultiLineYaml(title, content interface{}) string

func Compare

func Compare(name string, got, want interface{}, options ...CompareOptions) error

func LineDiff

func LineDiff(want, got string) string

func MatchSnapshot

func MatchSnapshot(t *testing.T, extension string, b interface{})

func MustJSON

func MustJSON(j interface{}) string

func MustToml

func MustToml(j interface{}) string

func MustYaml

func MustYaml(j interface{}) string

func OverwriteSnapshot

func OverwriteSnapshot(t *testing.T, extension string, b []byte)

func PrintMultiLineYaml

func PrintMultiLineYaml(title, content interface{})

func StringCompare

func StringCompare(t *testing.T, want, got string) error

func TPrintMultiLineYaml

func TPrintMultiLineYaml(t *testing.T, title, content interface{})

func YamlUnmarshalAllowTabs

func YamlUnmarshalAllowTabs(s string, j interface{}) error

Tabs are annoying in yaml, so lets just convert it.

Types

type CompareOptions

type CompareOptions struct {
	// Produces a diff of the result, but may in some edgecases not detect all errors (like differences in timezones)
	Diff,

	Reflect,

	Yaml bool
	JSON     bool
	TOML     bool
	IsString bool
}

type IncreasingTimeMock

type IncreasingTimeMock struct {
	Ticks       time.Duration
	TickAmmount time.Duration
	sync.RWMutex
	StartTime time.Time
}

func NewMockTimeNow

func NewMockTimeNow() *IncreasingTimeMock

func (*IncreasingTimeMock) Now

func (mt *IncreasingTimeMock) Now() time.Time

func (*IncreasingTimeMock) Tick

func (mt *IncreasingTimeMock) Tick() time.Time

Jump to

Keyboard shortcuts

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