test

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package test provides some simple assertion functions to simplify unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t testingTB, cond bool, val ...interface{})

Assert asserts that the given boolean value is true. If cond is false, the optional values will be passed to the testing.TB.Fatal function.

func Assertf

func Assertf(t testingTB, cond bool, format string, val ...interface{})

Assertf asserts that the given boolean value is true. If cond is false, the format and the optional values will be passed to the testing.TB.Fatal function.

func DeepEqual

func DeepEqual(t testingTB, a, b interface{})

DeepEqual asserts that `reflect.DeepEqual(a, b)` will return true.

func DeepPrint added in v0.2.0

func DeepPrint(out io.Writer, x interface{})

DeepPrint prints the given object with its fields recursively. Note that when a pointer is encountered more than once during printing, its subsequent occurrences after the first time will not be print in detail.

func Panic

func Panic(t testingTB, fn func())

Panic asserts that the given function will raise a recoverable panic.

func ThriftRandomFill added in v0.2.0

func ThriftRandomFill(obj interface{}, isUnion map[reflect.Type]bool) (err error)

ThriftRandomFill fills a thrift object with random values. The isUnion argument may used to specify union types which require exactly one field to be set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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