prototest

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T proto.Message](t *testing.T, want T, got T) bool

Equal asserts that [got] and [want] are two equal protobuf messages. Under the hood, this uses the go-cmp package in combination with protocmp and also supplies a diff, in case the messages to do not match.

func EqualSlice

func EqualSlice[T proto.Message](t *testing.T, want []T, got []T) bool

EqualSlice asserts that [got] and [want] are two equal protobuf message slices. Under the hood, this uses the go-cmp package in combination with protocmp and also supplies a diff, in case the messages to do not match.

func NewAny

func NewAny(t *testing.T, m proto.Message) *anypb.Any

NewAny creates a new *anypb.Any from a proto.Message with an assert that no error has been thrown.

func NewAnyWithPanic

func NewAnyWithPanic(m proto.Message) *anypb.Any

NewAny creates a new *anypb.Any from a proto.Message with a panic if an error has been thrown.

Types

This section is empty.

Jump to

Keyboard shortcuts

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