testutils

package
v0.0.0-...-e0046dd Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testutils contains helpers for use in testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogAll

func LogAll(t *testing.T, logged map[string]any)

LogAll is used to log items at the end of a test if desired

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.

Jump to

Keyboard shortcuts

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