test

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

Test

The core/test package contains helpers for aiding testing.

Examples

Equals
t.Run("foo equals foo", func(t *testing.T) {
    test.Equals(t, "foo", "foo")
})
Not equals
t.Run("foo does not equal foo", func(t *testing.T) {
    test.NotEquals(t, "foo", "bar")
})

Documentation

Overview

Package test contains helpers for aiding testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJSON

func BindJSON(r io.Reader, target interface{}) error

BindJSON takes a json stream and binds it to a struct.

func DialGRPC

func DialGRPC(addr string, opts ...grpc.DialOption) *grpc.ClientConn

DialGRPC will connect to a grpc server on a specific port.

func Equals

func Equals(tb testing.TB, expected, actual interface{})

Equals performs a deep equal comparison against two values and fails if they are not the same.

func NotEquals

func NotEquals(tb testing.TB, expected, actual interface{})

NotEquals performs a deep equal comparison against two values and fails if they are the same.

func ToJSONBody

func ToJSONBody(tb testing.TB, i interface{}) io.Reader

ToJSONBody turns a struct into a json body.

Types

This section is empty.

Jump to

Keyboard shortcuts

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