-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathudp_test.go
47 lines (41 loc) · 1010 Bytes
/
udp_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package gosc
import (
"testing"
)
func TestNewUDPTransport(t *testing.T) {
t.Run("correctAddress", func(t *testing.T) {
_, err := NewUDPTransport("127.0.0.1:1234", 512)
if err != nil {
t.Errorf("expected no error but got: %v", err)
}
})
t.Run("malformedAddress", func(t *testing.T) {
_, err := NewUDPTransport("512.abc:001", 512)
if err == nil {
t.Error("expected error but none given")
}
})
}
func TestNewUDPListen(t *testing.T) {
t.Run("correctAddress", func(t *testing.T) {
_, err := NewUDPListen("127.0.0.1:1234", 512)
if err != nil {
t.Errorf("expected no error but got: %v", err)
}
})
t.Run("malformedAddress", func(t *testing.T) {
_, err := NewUDPListen("512.abc:001", 512)
if err == nil {
t.Error("expected error but none given")
}
})
}
func Test_transportUDP_Receive(t1 *testing.T) {
// TODO: Implement me
}
func Test_transportUDP_Send(t1 *testing.T) {
// TODO: Implement me
}
func Test_transportUDP_Close(t1 *testing.T) {
// TODO: Implement me
}