runtimetest

package
v0.386.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertIsTimeNow

func AssertIsTimeNow(t *testing.T, v any)

AssertIsTimeNow makes sure that the given value can be type-coerced to a time.Time, and that its value encodes now() - given a 5 second tolerance.

func AssertKSUIDIsNow

func AssertKSUIDIsNow(t *testing.T, v any)

AssertKSUIDIsNow makes sure that the given value can be type-coerced to a ksuid.KSUID, and that the time it encodes is roughly now() - given a 5 second tolerance.

func AssertValueAtPath

func AssertValueAtPath(t *testing.T, d map[string]any, path string, expected any)

AssertValueAtPath splits a path like "foo.bar.baz" into dot-delimited segments (the keys). Then it tries to drill into the given map (recursively) using those keys. It then makes sure the value thus found is the given expected value.

func GetValueAtPath

func GetValueAtPath(t *testing.T, theMap map[string]any, path string) any

getValueAtPath splits a path like "foo.bar.baz" into dot-delimited segments (the keys). Then it tries to drill into the given map (recursively) using those keys. It returns the value thus found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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