Skip to content

Commit

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



* ♻️ Fix by feedback



* ♻️ Fix by feedback



---------

Signed-off-by: vankichi <[email protected]>
Co-authored-by: Kiichiro YUKAWA <[email protected]>
  • Loading branch information
vdaas-ci and vankichi authored Sep 11, 2024
1 parent 4111b89 commit 1f24c38
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 1f24c38

Please sign in to comment.