Documentation
¶
Overview ¶
Package test contains test data and generic tests for testing bindings.
Package test provides re-usable functions for binding tests.
Index ¶
- func AllVersions(events []ce.Event) []ce.Event
- func AssertMessageEqual(t testing.TB, x, y binding.Message)
- func AssertMessageEventEqual(t testing.TB, x, y binding.Message)
- func Canonical(t *testing.T, c ce.EventContext)
- func DiffMessageStruct(x, y binding.Message) string
- func EachEvent(t *testing.T, events []ce.Event, f func(*testing.T, ce.Event))
- func EachMessage(t *testing.T, messages []binding.Message, f func(*testing.T, binding.Message))
- func EncodeAll(t *testing.T, in []ce.Event, enc binding.Encoder) (out []binding.Message)
- func EncodeDecode(t *testing.T, in ce.Event, enc binding.Encoder) (out ce.Event)
- func Events() []ce.Event
- func FullEvent() ce.Event
- func MinEvent() ce.Event
- func MustJSON(e ce.Event) []byte
- func NameOf(x interface{}) string
- func NoExtensions(events []ce.Event) []ce.Event
- func SendReceive(t *testing.T, in binding.Message, s binding.Sender, r binding.Receiver) binding.Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllVersions ¶
AllVersions returns all versions of each event in events. ID gets a -number suffix so IDs are unique.
func AssertMessageEqual ¶
AssertMessageEqual asserts that x and y are both structured or both binary and equal.
func AssertMessageEventEqual ¶
AssertMessageEventEqual compares x.Event() and y.Event()
func Canonical ¶
func Canonical(t *testing.T, c ce.EventContext)
Canonical converts all attributes to canonical string form for comparisons.
func DiffMessageStruct ¶
DiffMessageStruct compares x.Structured() and y.Structured()
func EachMessage ¶
Run f as a test for each message in messages
func EncodeDecode ¶
EncodeDecode enc.Encode(); m.Decode(); return result. Halt test on error.
func Events ¶
Events is a set of test events that should be handled correctly by all event-processing code.
func NameOf ¶
func NameOf(x interface{}) string
NameOf generates a string test name from x, esp. for ce.Event and ce.Message.
func NoExtensions ¶
NoExtensions returns a copy of events with no Extensions. Use for testing where extensions are not supported.
Types ¶
This section is empty.