forked from TrueCloudLab/tzhash
Use testify in tests
This commit is contained in:
parent
4b11f50264
commit
e1d9fc8058
1 changed files with 5 additions and 9 deletions
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
const benchDataSize = 1000000
|
const benchDataSize = 100000
|
||||||
|
|
||||||
var testCases = []struct {
|
var testCases = []struct {
|
||||||
input []byte
|
input []byte
|
||||||
|
@ -36,10 +36,8 @@ func TestHash(t *testing.T) {
|
||||||
d.Reset()
|
d.Reset()
|
||||||
_, _ = d.Write(tc.input)
|
_, _ = d.Write(tc.input)
|
||||||
sum := d.checkSum()
|
sum := d.checkSum()
|
||||||
hash := hex.EncodeToString(sum[:])
|
|
||||||
if hash != tc.hash {
|
require.Equal(t, tc.hash, hex.EncodeToString(sum[:]))
|
||||||
t.Errorf("expected (%s), got (%s)", tc.hash, hash)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -49,10 +47,8 @@ func TestHash(t *testing.T) {
|
||||||
d.Reset()
|
d.Reset()
|
||||||
_, _ = d.Write(tc.input)
|
_, _ = d.Write(tc.input)
|
||||||
sum := d.checkSum()
|
sum := d.checkSum()
|
||||||
hash := hex.EncodeToString(sum[:])
|
|
||||||
if hash != tc.hash {
|
require.Equal(t, tc.hash, hex.EncodeToString(sum[:]))
|
||||||
t.Errorf("expected (%s), got (%s)", tc.hash, hash)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue