testingutils

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlmostEqual

func AlmostEqual(a, b float64) bool

AlmostEqual compares two floats so see if they are roughly equal

func Assert

func Assert(tb testing.TB, condition bool, msg string, v ...interface{})

Assert fails the test if the condition is false.

func ContainsString added in v0.15.0

func ContainsString(tb testing.TB, exp string, act []string)

Check if a string is found in a given slice of strings

func Equals

func Equals(tb testing.TB, exp, act interface{})

Equals fails the test if exp is not equal to act.

func FileEquals

func FileEquals(tb testing.TB, exp, act string)

FileEquals fails if the SHA256 checksum of the exp if not equal to the checksum of the act

func Ok

func Ok(tb testing.TB, err error)

Ok fails the test if an err is not nil.

func RandomPassword added in v0.14.14

func RandomPassword(length int) string

RandomPassword generate a random password that meets the default Cumulocity IoT password policy

func RandomString

func RandomString(length int) string

RandomString returns a random string of the given length

Types

This section is empty.

Jump to

Keyboard shortcuts

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