testutil

package
v0.0.0-...-b57e8ac Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareAndSetByPathNum

func CompareAndSetByPathNum[T types.CompositeType](tb testing.TB, expected, actual T, delta float64, path ...string)

CompareAndSetByPathNum asserts that two values with the same path in two objects (documents or arrays) are within a given numerical delta, then updates the expected object with the actual value.

func CompareAndSetByPathTime

func CompareAndSetByPathTime[T types.CompositeType](tb testing.TB, expected, actual T, delta time.Duration, path ...string)

CompareAndSetByPathTime asserts that two values with the same path in two objects (documents or arrays) are within a given time delta, then updates the expected object with the actual value.

func Ctx

func Ctx(tb testing.TB) context.Context

func GetByPath

func GetByPath[T types.CompositeType](tb testing.TB, comp T, path ...string) any

GetByPath returns a value by path - a sequence of indexes and keys.

func MustParseDumpFile

func MustParseDumpFile(path ...string) []byte

func ParseDump

func ParseDump(tb testing.TB, s string) []byte

func ParseDumpFile

func ParseDumpFile(tb testing.TB, path ...string) []byte

func SetByPath

func SetByPath[T types.CompositeType](tb testing.TB, comp T, value any, path ...string)

SetByPath sets the value by path - a sequence of indexes and keys.

The path must exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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