Documentation ¶
Overview ¶
Package testutils contains helpers for use in testing
Index ¶
- func LogAll(t *testing.T, logged map[string]any)
- func MakeItem(uval string) *statusthingv1.Item
- func MakeNote(uval string) *statusthingv1.Note
- func MakeStatus(uval string) *statusthingv1.Status
- func MakeTimestamps(deleted bool) *statusthingv1.Timestamps
- func MakeUser(uval string) *statusthingv1.User
- func TimestampsEqual(expected *statusthingv1.Timestamps, actual *statusthingv1.Timestamps) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeItem ¶
func MakeItem(uval string) *statusthingv1.Item
MakeItem makes a valid minimal statusthingv1.Item for tests uval is generally the name of the current test (t.Name()) if determinism is needed but can be any value to use as the base for any string values
func MakeNote ¶
func MakeNote(uval string) *statusthingv1.Note
MakeNote makes a valid minimal statusthingv1.Note for tests uval is generally the name of the current test (t.Name()) if determinism is needed but can be any value to use as the base for any string values
func MakeStatus ¶
func MakeStatus(uval string) *statusthingv1.Status
MakeStatus makes a valid minimal statusthingv1.Status for tests uval is generally the name of the current test (t.Name()) if determinism is needed but can be any value to use as the base for any string values
func MakeTimestamps ¶
func MakeTimestamps(deleted bool) *statusthingv1.Timestamps
MakeTimestamps creates a statusthingv1.Timestamps based on the current time, optionally populating the deleted value
func MakeUser ¶
func MakeUser(uval string) *statusthingv1.User
MakeUser makes a valid minimal statusthingv1.User for tests uval is generally the name of the current test (t.Name()) if determinism is needed but can be any value to use as the base for any string values
func TimestampsEqual ¶
func TimestampsEqual(expected *statusthingv1.Timestamps, actual *statusthingv1.Timestamps) bool
TimestampsEqual cuts down on error-prone copy/paste when needing to test timestamp equality
Types ¶
This section is empty.