* Update anacrolix/go-libutp (v1.1.0 -> v1.2.0) * Pass client logger to anacrolix/go-libutp * Pass logger instead of option The project now compiles properly when CGO is not enabled. Additionally, the new argument (now log.Logger instead of utp.NewSocketOpt) is now required. The tests have been updated to match this change, and now pass logger.Default to NewUtpSocket. * Correct function signature of NewUtpSocket
18 lines
310 B
Go
18 lines
310 B
Go
package torrent
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/anacrolix/log"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewUtpSocketErrorNilInterface(t *testing.T) {
|
|
s, err := NewUtpSocket("fix", "your:language", nil, log.Default)
|
|
assert.Error(t, err)
|
|
if s != nil {
|
|
t.Fatalf("expected nil, got %#v", s)
|
|
}
|
|
}
|