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

@ -124,9 +124,7 @@ func getTestingInterop(id uint32) *InteropFuncPrice {
func testFile(t *testing.T, filename string) {
data, err := ioutil.ReadFile(filename)
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)
// FIXME remove when NEO 3.0 https://github.com/nspcc-dev/neo-go/issues/477
if len(data) > 2 && data[0] == 0xef && data[1] == 0xbb && data[2] == 0xbf {
@ -134,9 +132,7 @@ func testFile(t *testing.T, filename string) {
}
ut := new(vmUT)
if err = json.Unmarshal(data, ut); err != nil {
t.Fatal(err)
}
require.NoError(t, json.Unmarshal(data, ut))
t.Run(ut.Category+":"+ut.Name, func(t *testing.T) {
for i := range ut.Tests {