From a8489bc5f0f809ae9191852ff1abaa2ca09671ec Mon Sep 17 00:00:00 2001 From: vankichi Date: Mon, 9 Sep 2024 12:21:06 +0900 Subject: [PATCH 1/3] :bug: :white_check_mark: Fix checkFun condition Signed-off-by: vankichi --- internal/test/data/vector/gen_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/test/data/vector/gen_test.go b/internal/test/data/vector/gen_test.go index 24f1c11bee..df0c9f0948 100644 --- a/internal/test/data/vector/gen_test.go +++ b/internal/test/data/vector/gen_test.go @@ -47,7 +47,7 @@ func TestFloat32VectorGenerator(t *testing.T) { } if got != nil { vectors := got(a.n, a.dim) - if len(vectors) != w.n && len(vectors[0]) != w.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) } } @@ -140,7 +140,7 @@ func TestUint8VectorGenerator(t *testing.T) { } if got != nil { vectors := got(a.n, a.dim) - if len(vectors) != w.n && len(vectors[0]) != w.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) } } From 4d60fae1a4d5be30105118f1530bdd5283a87103 Mon Sep 17 00:00:00 2001 From: vankichi Date: Mon, 9 Sep 2024 12:35:51 +0900 Subject: [PATCH 2/3] :recycle: Fix by feedback Signed-off-by: vankichi --- internal/test/data/vector/gen_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/test/data/vector/gen_test.go b/internal/test/data/vector/gen_test.go index df0c9f0948..5f474ad03c 100644 --- a/internal/test/data/vector/gen_test.go +++ b/internal/test/data/vector/gen_test.go @@ -47,7 +47,7 @@ func TestFloat32VectorGenerator(t *testing.T) { } if got != nil { vectors := got(a.n, a.dim) - if !(len(vectors) == w.n && len(vectors[0]) == w.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) } } @@ -140,7 +140,7 @@ func TestUint8VectorGenerator(t *testing.T) { } if got != nil { vectors := got(a.n, a.dim) - if !(len(vectors) == w.n && len(vectors[0]) == w.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) } } From fbeb95f8d8ee1ac0b596ae4ac68d11e9309eff7d Mon Sep 17 00:00:00 2001 From: vankichi Date: Mon, 9 Sep 2024 13:31:31 +0900 Subject: [PATCH 3/3] :recycle: Fix by feedback Signed-off-by: vankichi --- internal/test/data/vector/gen_test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/internal/test/data/vector/gen_test.go b/internal/test/data/vector/gen_test.go index 5f474ad03c..4f3049b4ae 100644 --- a/internal/test/data/vector/gen_test.go +++ b/internal/test/data/vector/gen_test.go @@ -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 @@ -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