testenv

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 8 Imported by: 2

Documentation

Overview

Package testenv provides general test utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesEqual

func BytesEqual(a *assert.Assertions, expected, actual []byte, msgAndArgs ...any) bool

BytesEqual asserts that actual bytes equals expected bytes. It considers nil slice and zero-length slice to be the same.

func BytesFromHex

func BytesFromHex(input string) []byte

BytesFromHex converts a hexadecimal string to a byte slice. The octets must be written as upper case. All characters other than [0-9A-F] are considered comments and stripped.

func Exit

func Exit(code int)

func FromJSON

func FromJSON[T any](j string) (value T)

FromJSON unmarshals from JSON string. Error causes panic.

func MakeAR

MakeAR creates testify assert and require objects.

func RandBytes

func RandBytes(p []byte)

RandBytes fills []byte with non-crypto-safe random bytes.

func ToJSON

func ToJSON(v any) string

ToJSON marshals a value as JSON string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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