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 AssertEventEquals(t *testing.T, want cloudevents.Event, have cloudevents.Event)
- func BenchmarkSendReceive(b *testing.B, s binding.Sender, r binding.Receiver)
- func Canonical(t *testing.T, c ce.EventContext)
- 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 Events() []ce.Event
- func ExToStr(t *testing.T, e ce.Event) ce.Event
- func FullEvent() ce.Event
- func MinEvent() ce.Event
- func MustJSON(e ce.Event) []byte
- func MustToEvent(m binding.Message) (e ce.Event, wasStructured bool, wasBinary bool)
- 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, ...)
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 AssertEventEquals ¶ added in v0.11.0
func AssertEventEquals(t *testing.T, want cloudevents.Event, have cloudevents.Event)
func BenchmarkSendReceive ¶ added in v0.10.1
Simple send/receive benchmark. Requires a sender and receiver that are connected to each other.
func Canonical ¶
func Canonical(t *testing.T, c ce.EventContext)
Canonical converts all attributes to canonical string form for comparisons.
func EachMessage ¶
Run f as a test for each message in messages
func Events ¶
Events is a set of test events that should be handled correctly by all event-processing code.
func MustToEvent ¶ added in v0.11.0
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.