osmoassert

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConditionalError

func ConditionalError(t *testing.T, expectError bool, err error)

ConditionalError checks if expectError is true, asserts that err is an error If expectError is false, asserts that err is nil

func ConditionalPanic

func ConditionalPanic(t *testing.T, expectPanic bool, sut func())

ConditionalPanic checks if expectPanic is true, asserts that sut (system under test) panics. If expectPanic is false, asserts that sut does not panic. returns true if sut panics and false it it does not

func DecApproxEq

func DecApproxEq(t *testing.T, d1 osmomath.Dec, d2 osmomath.Dec, tol osmomath.Dec, msgAndArgs ...interface{})

DecApproxEq is a helper function to compare two decimals. It validates the two decimal are within a certain tolerance. If not, it fails with a message.

func Equal added in v0.0.8

func Equal[T Stringer](t *testing.T, tolerance osmomath.ErrTolerance, A, B T)

Equal compares A with B and asserts that they are equal within tolerance error tolerance

func Uint64ArrayValuesAreUnique added in v0.0.8

func Uint64ArrayValuesAreUnique(values []uint64) bool

Types

type Stringer added in v0.0.8

type Stringer interface {
	String() string
}

Jump to

Keyboard shortcuts

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