tests: replace t.Fatal with require where possible

This makes tests less verbose and unifies the style
they are written in.
This commit is contained in:
Evgenii Stratonikov 2020-02-29 18:55:16 +03:00
parent 66f96e3f32
commit a3dacd3b74
14 changed files with 52 additions and 120 deletions

View file

@ -12,6 +12,7 @@ import (
"github.com/CityOfZion/neo-go/pkg/encoding/address"
"github.com/CityOfZion/neo-go/pkg/network"
"github.com/CityOfZion/neo-go/pkg/rpc/request"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)
@ -38,12 +39,8 @@ func BenchmarkTXPerformanceTest(t *testing.B) {
t.ResetTimer()
for n := 0; n < t.N; n++ {
if server.RelayTxn(data[n]) != network.RelaySucceed {
t.Fail()
}
if server.RelayTxn(data[n]) != network.RelayAlreadyExists {
t.Fail()
}
assert.Equal(t, network.RelaySucceed, server.RelayTxn(data[n]))
assert.Equal(t, network.RelayAlreadyExists, server.RelayTxn(data[n]))
}
chain.Close()
}