tracker_test: Check for the error string instead of the type
The type changes from Go 1.4->1.5, and it's not worth tearing it apart.
This commit is contained in:
parent
7ecc8108bf
commit
c735370f9b
|
@ -10,9 +10,10 @@ import (
|
|||
"net"
|
||||
"net/url"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/anacrolix/torrent/util"
|
||||
)
|
||||
|
||||
|
@ -58,10 +59,7 @@ func TestLongWriteUDP(t *testing.T) {
|
|||
for msgLen := 1; ; msgLen *= 2 {
|
||||
n, err := c.Write(make([]byte, msgLen))
|
||||
if err != nil {
|
||||
err := err.(*net.OpError).Err
|
||||
if err != syscall.EMSGSIZE {
|
||||
t.Fatalf("write error isn't EMSGSIZE: %s", err)
|
||||
}
|
||||
require.Contains(t, err.Error(), "message too long")
|
||||
return
|
||||
}
|
||||
if n < msgLen {
|
||||
|
|
Loading…
Reference in New Issue