util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(t *testing.T, reader io.Reader, data any)

DecodeJSON decodes data from the provided reader into the given interface fatally terminating the current test in the event of a failure.

func EncodeJSON

func EncodeJSON(t *testing.T, writer io.Writer, data any)

EncodeJSON marshals then writes the provided interface to the given writer fatally terminating the current test in the event of a failure.

func MarshalJSON

func MarshalJSON(t *testing.T, data any) []byte

MarshalJSON marshals the provided interface to JSON fatally terminating the current test in the event of a failure.

func Read

func Read(t *testing.T, reader io.Reader, data []byte)

Read len(data) bytes from the provided reader fatally terminating the current test in the even of a failure.

func ReadAll

func ReadAll(t *testing.T, reader io.Reader) []byte

ReadAll the data from the provided reader fatally terminating the current test in the even of a failure.

func UnmarshalJSON

func UnmarshalJSON(t *testing.T, dJSON []byte, data any)

UnmarshalJSON unmarshals the provide JSON data into the given interface fatally terminating the current test in the even of a failure.

func Write

func Write(t *testing.T, writer io.Writer, data []byte)

Write the given data to the provided writer fatally terminating the current test in the event of a failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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