File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
package osc
2
2
3
3
import (
4
+ "net"
4
5
"testing"
5
6
)
6
7
8
+ func TestUDPConn (t * testing.T ) {
9
+ laddr , err := net .ResolveUDPAddr ("udp" , "127.0.0.1:0" )
10
+ if err != nil {
11
+ t .Fatal (err )
12
+ }
13
+ lc , err := ListenUDP ("udp" , laddr )
14
+ if err != nil {
15
+ t .Fatal (err )
16
+ }
17
+ var c Conn = lc
18
+ _ = c
19
+ }
20
+
7
21
func TestValidateAddress (t * testing.T ) {
8
22
if err := ValidateAddress ("/foo" ); err != nil {
9
23
t .Fatal (err )
Original file line number Diff line number Diff line change 1
1
package osc
2
2
3
3
import (
4
- "io"
5
4
"net"
6
5
7
6
"github.com/pkg/errors"
8
7
)
9
8
10
9
// udpConn includes exactly the methods we need from *net.UDPConn
11
10
type udpConn interface {
12
- io. WriteCloser
11
+ net. Conn
13
12
14
- LocalAddr () net.Addr
15
- RemoteAddr () net.Addr
16
13
ReadFromUDP ([]byte ) (int , * net.UDPAddr , error )
17
14
WriteTo ([]byte , net.Addr ) (int , error )
18
15
}
You can’t perform that action at this time.
0 commit comments