Skip to content

Commit

Permalink
Refactor test checkFunc condition (#2599)
Browse files Browse the repository at this point in the history
* 🐛 ✅ Fix checkFun condition

Signed-off-by: vankichi <[email protected]>

* ♻️ Fix by feedback

Signed-off-by: vankichi <[email protected]>

* ♻️ Fix by feedback

Signed-off-by: vankichi <[email protected]>

---------

Signed-off-by: vankichi <[email protected]>
  • Loading branch information
vankichi authored Sep 10, 2024
1 parent b17cc73 commit f418cc9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions internal/test/data/vector/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ func TestFloat32VectorGenerator(t *testing.T) {
}
if got != nil {
vectors := got(a.n, a.dim)
if len(vectors) != w.n && len(vectors[0]) != w.dim {
return errors.Errorf("got: \"%d\",\"%d\"\n\t\t\t\twant: \"%d\",\"%d\"", len(vectors), len(vectors[0]), w.n, w.dim)
if len(vectors) != w.n {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twantLen: \"%#v\"", len(vectors), w.n)
}
for _, vec := range vectors {
if len(vec) != w.dim {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twantDim: \"%#v\"", len(vec), w.dim)
}
}
}
return nil
Expand Down Expand Up @@ -140,8 +145,13 @@ func TestUint8VectorGenerator(t *testing.T) {
}
if got != nil {
vectors := got(a.n, a.dim)
if len(vectors) != w.n && len(vectors[0]) != w.dim {
return errors.Errorf("got: \"%d\",\"%d\"\n\t\t\t\twant: \"%d\",\"%d\"", len(vectors), len(vectors[0]), w.n, w.dim)
if len(vectors) != w.n {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twantLen: \"%#v\"", len(vectors), w.n)
}
for _, vec := range vectors {
if len(vec) != w.dim {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twantDim: \"%#v\"", len(vec), w.dim)
}
}
}
return nil
Expand Down

0 comments on commit f418cc9

Please sign in to comment.