testhelper

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package testdata provides - big surprise - helper functions to be used in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONEqExp added in v0.15.1

func JSONEqExp(t assert.TestingT, expected string, actual string, excludedFields []string, msgAndArgs ...any) bool

JSONEqExp is like assert.JSONEq() but excludes the given fields (given in sjson notation: https://github.com/tidwall/sjson).

func MustTimeParse

func MustTimeParse(tb testing.TB, layout, value string) time.Time

MustTimeParse parses the given time string using the given layout.

func SafeClearEnv

func SafeClearEnv(tb testing.TB)

SafeClearEnv clears the environment but restores it when the test finishes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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