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:
Matt Joiner 2015-08-02 14:57:28 +10:00
parent 7ecc8108bf
commit c735370f9b
1 changed files with 3 additions and 5 deletions

View File

@ -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 {