testutil

package
v0.0.0-...-f0dc348 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NextMessageRequestId uint64

Functions

func Assert

func Assert(tb TB, condition bool, format string, a ...interface{})

Assert fails the test if the condition is false.

func Dial

func Dial(t *testing.T) net.Conn

func Equals

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

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

func MakeMessagePublish

func MakeMessagePublish(t *testing.T, topic string) []byte

func MakeMessageRegister

func MakeMessageRegister(t *testing.T, serviceName string, serviceIdent string) []byte

func MakeMessageReply

func MakeMessageReply(t *testing.T, msgId uint64, payload []byte) []byte

func MakeMessageRequest

func MakeMessageRequest(t *testing.T, service string, ident string, method string, payload []byte) []byte

func MakeMessageSubscribe

func MakeMessageSubscribe(t *testing.T, topic string) []byte

func MessageForNetwork

func MessageForNetwork(t *testing.T, msg *cellaserv.Message) []byte

func MsgTypeIs

func MsgTypeIs(t *testing.T, msg *cellaserv.Message, msgType cellaserv.Message_MessageType)

func NotOk

func NotOk(tb TB, err error, format string, a ...interface{})

NotOk fails the test if an err is nil.

func Ok

func Ok(tb TB, err error)

Ok fails the test if an err is not nil.

func RecvMessage

func RecvMessage(t *testing.T, conn net.Conn) *cellaserv.Message

func RecvReply

func RecvReply(t *testing.T, conn net.Conn) []byte

Types

type TB

type TB interface {
	Helper()
	Fatalf(string, ...interface{})
}

This package is imported by non-test code and therefore cannot import the testing package, which has side effects such as adding flags. Hence we use an interface to testing.{T,B}.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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