Documentation ¶
Overview ¶
Package udp implements UDP test helpers. It lets you assert that certain strings must or must not be sent to a given local UDP listener.
Index ¶
- Variables
- func ReceiveString(t *testing.T, body fn) string
- func RemoteAddr() net.Addr
- func SetAddr(a string)
- func ShouldNotReceive(t *testing.T, expected string, body fn)
- func ShouldNotReceiveAny(t *testing.T, unexpected []string, body fn)
- func ShouldNotReceiveOnly(t *testing.T, notExpected string, body fn)
- func ShouldReceive(t *testing.T, expected string, body fn)
- func ShouldReceiveAll(t *testing.T, expected []string, body fn)
- func ShouldReceiveAllAndNotReceiveAny(t *testing.T, expected []string, unexpected []string, body fn)
- func ShouldReceiveOnly(t *testing.T, expected string, body fn)
- func Write(b []byte) (n int, err error)
- func WriteTo(b []byte, addr net.Addr) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var (
Timeout = time.Millisecond
)
Functions ¶
func ReceiveString ¶
func RemoteAddr ¶
func ShouldNotReceive ¶
ShouldNotReceive will fire a test error if the given function sends the given string over UDP.
func ShouldNotReceiveAny ¶
ShouldNotReceiveAny will fire a test error if any of the given strings are sent over UDP.
func ShouldNotReceiveOnly ¶
ShouldNotReceiveOnly will fire a test error if the given function sends exactly the given string over UDP.
func ShouldReceive ¶
ShouldReceive will fire a test error if the given function doesn't send the given string over UDP.
func ShouldReceiveAll ¶
ShouldReceiveAll will fire a test error unless all of the given strings are sent over UDP.
func ShouldReceiveOnly ¶
ShouldReceiveOnly will fire a test error if the given function doesn't send exactly the given string over UDP.
Types ¶
This section is empty.