From d2db202a2dab9d1549e3044c7eb863b497dc62b8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 2 Dec 2017 23:39:38 -0500 Subject: [PATCH] mempool: assert -> require in test --- mempool/mempool_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index 19ee157c4..4d75cc58d 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -21,7 +21,6 @@ import ( "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -125,7 +124,7 @@ func TestSerialReap(t *testing.T) { appConnCon, _ := cc.NewABCIClient() appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus")) err := appConnCon.Start() - assert.Nil(t, err) + require.Nil(t, err) cacheMap := make(map[string]struct{}) deliverTxsRange := func(start, end int) { @@ -138,21 +137,21 @@ func TestSerialReap(t *testing.T) { err := mempool.CheckTx(txBytes, nil) _, cached := cacheMap[string(txBytes)] if cached { - assert.NotNil(t, err, "expected error for cached tx") + require.NotNil(t, err, "expected error for cached tx") } else { - assert.Nil(t, err, "expected no err for uncached tx") + require.Nil(t, err, "expected no err for uncached tx") } cacheMap[string(txBytes)] = struct{}{} // Duplicates are cached and should return error err = mempool.CheckTx(txBytes, nil) - assert.NotNil(t, err, "Expected error after CheckTx on duplicated tx") + require.NotNil(t, err, "Expected error after CheckTx on duplicated tx") } } reapCheck := func(exp int) { txs := mempool.Reap(-1) - assert.Equal(t, len(txs), exp, cmn.Fmt("Expected to reap %v txs but got %v", exp, len(txs))) + require.Equal(t, len(txs), exp, cmn.Fmt("Expected to reap %v txs but got %v", exp, len(txs))) } updateRange := func(start, end int) {