testing clean up

This commit is contained in:
Roy Han
2024-07-11 20:20:14 -07:00
parent dbe9527305
commit 53e9576f46
2 changed files with 8 additions and 7 deletions

View File

@@ -483,7 +483,7 @@ func TestNormalize(t *testing.T) {
{input: []float32{0, 0, 0}},
}
assertNorm := func(vec []float32) (res bool) {
isNormalized := func(vec []float32) (res bool) {
sum := 0.0
for _, v := range vec {
sum += float64(v * v)
@@ -498,7 +498,7 @@ func TestNormalize(t *testing.T) {
for _, tc := range testCases {
t.Run("", func(t *testing.T) {
normalized := normalize(tc.input)
if !assertNorm(normalized) {
if !isNormalized(normalized) {
t.Errorf("Vector %v is not normalized", tc.input)
}
})