testutil

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testutil implements functionality the test suites consume.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual added in v1.4.2

func AssertEqual(tb testing.TB, expected, actual any) (are bool)

AssertEqual asserts that want & have are equal.

func HexString

func HexString(tb testing.TB, l int) string

HexString returns a string of l hex characters.

func ParseIP

func ParseIP(tb testing.TB, s string) (ip net.IP)

ParseIP parses s as an IP address, returning the result.

If s is not a valid textual representation of an IP address, ParseIP will fail tb.

func RNG

func RNG(tb testing.TB) *mand.Rand

RNG returns a reference to a Rand that's been seeded with a random seed.

func ReadAll added in v1.4.2

func ReadAll(tb testing.TB, r io.Reader) string

ReadAll reads r into a string.

Should an error occur while reading from r, ReadAll will fail tb.

Types

This section is empty.

Jump to

Keyboard shortcuts

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