Skip to content

Commit

Permalink
Moved tests [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jun 4, 2024
1 parent 18f3a7e commit 0549774
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions halfvec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
"github.com/pgvector/pgvector-go"
)

func TestHalfVectorString(t *testing.T) {
func TestHalfVectorSlice(t *testing.T) {
vec := pgvector.NewHalfVector([]float32{1, 2, 3})
if fmt.Sprint(vec) != "[1,2,3]" {
t.Errorf("Bad string")
if !reflect.DeepEqual(vec.Slice(), []float32{1, 2, 3}) {
t.Errorf("Bad slice")
}
}

func TestHalfVectorSlice(t *testing.T) {
func TestHalfVectorString(t *testing.T) {
vec := pgvector.NewHalfVector([]float32{1, 2, 3})
if !reflect.DeepEqual(vec.Slice(), []float32{1, 2, 3}) {
t.Errorf("Bad slice")
if fmt.Sprint(vec) != "[1,2,3]" {
t.Errorf("Bad string")
}
}

Expand Down
12 changes: 6 additions & 6 deletions sparsevec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
"github.com/pgvector/pgvector-go"
)

func TestSparseVectorString(t *testing.T) {
func TestSparseVectorSlice(t *testing.T) {
vec := pgvector.NewSparseVector([]float32{1, 0, 2, 0, 3, 0})
if fmt.Sprint(vec) != "{1:1,3:2,5:3}/6" {
t.Errorf("Bad string")
if !reflect.DeepEqual(vec.Slice(), []float32{1, 0, 2, 0, 3, 0}) {
t.Errorf("Bad slice")
}
}

func TestSparseVectorSlice(t *testing.T) {
func TestSparseVectorString(t *testing.T) {
vec := pgvector.NewSparseVector([]float32{1, 0, 2, 0, 3, 0})
if !reflect.DeepEqual(vec.Slice(), []float32{1, 0, 2, 0, 3, 0}) {
t.Errorf("Bad slice")
if fmt.Sprint(vec) != "{1:1,3:2,5:3}/6" {
t.Errorf("Bad string")
}
}
12 changes: 6 additions & 6 deletions vector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
"github.com/pgvector/pgvector-go"
)

func TestVectorString(t *testing.T) {
func TestVectorSlice(t *testing.T) {
vec := pgvector.NewVector([]float32{1, 2, 3})
if fmt.Sprint(vec) != "[1,2,3]" {
t.Errorf("Bad string")
if !reflect.DeepEqual(vec.Slice(), []float32{1, 2, 3}) {
t.Errorf("Bad slice")
}
}

func TestVectorSlice(t *testing.T) {
func TestVectorString(t *testing.T) {
vec := pgvector.NewVector([]float32{1, 2, 3})
if !reflect.DeepEqual(vec.Slice(), []float32{1, 2, 3}) {
t.Errorf("Bad slice")
if fmt.Sprint(vec) != "[1,2,3]" {
t.Errorf("Bad string")
}
}

Expand Down

0 comments on commit 0549774

Please sign in to comment.