expect

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareValues

func CompareValues(expected, actual interface{}, exactJSON bool) []error

CompareValues compares an expected value to an actual value.

Types

type Predicate

type Predicate func(interface{}) error

A Predicate is a function that takes a test result value and possibly returns an error.

func Bool

func Bool(expected ...bool) Predicate

Bool creates a predicate requiring a value to be a bool, optionally matching against a set of values.

func Float64

func Float64(expected ...float64) Predicate

Float64 creates a predicate requiring a value to be a float64, optionally matching against a set of values.

func Int64

func Int64(expected ...int64) Predicate

Int64 creates a predicate requiring a value to be an int64, optionally matching against a set of values.

func Map

func Map(expected ...map[string]interface{}) Predicate

Map creates a predicate requiring a value to be a map, optionally matching against a set of values.

func Slice

func Slice(expected ...[]interface{}) Predicate

Slice creates a predicate requiring a value to be a slice, optionally matching against a set of values.

func String

func String(expected ...string) Predicate

String creates a predicate requiring a value to be a string, optionally matching against a set of values.

func (Predicate) Then

func (p Predicate) Then(next Predicate) Predicate

Then creates a new predicate by chaining the given predicates.

Jump to

Keyboard shortcuts

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