From ac184c8f52414239c0775793ca2222e2bd1942be Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 24 Mar 2016 23:52:38 +1100 Subject: [PATCH] Tidy up a test that fails with the wrong reasons --- client_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client_test.go b/client_test.go index ccb60b5d..9760a8ab 100644 --- a/client_test.go +++ b/client_test.go @@ -234,18 +234,15 @@ func TestTwoClientsArbitraryPorts(t *testing.T) { } func TestAddDropManyTorrents(t *testing.T) { - cl, _ := NewClient(&TestingConfig) + cl, err := NewClient(&TestingConfig) + require.NoError(t, err) defer cl.Close() for i := range iter.N(1000) { var spec TorrentSpec binary.PutVarint(spec.InfoHash[:], int64(i)) tt, new, err := cl.AddTorrentSpec(&spec) - if err != nil { - t.Error(err) - } - if !new { - t.FailNow() - } + assert.NoError(t, err) + assert.True(t, new) defer tt.Drop() } } -- 2.48.1