Skip to content

Commit 95f713e

Browse files
cpegericashvardanian
authored andcommitted
Fix: Filtered search test logic and remove debug output
1 parent 72a9f5a commit 95f713e

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

golang/lib_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,10 @@ func TestUnsafeOperations(t *testing.T) {
649649
// Test FilteredSearchUnsafe
650650
handler := &FilteredSearchHandler{
651651
f: func(key Key, ptr unsafe.Pointer) int {
652-
fmt.Println(key)
653652
if key%2 == 0 {
654-
return 1
653+
return 0
655654
}
656-
return 0
655+
return 1
657656
},
658657
}
659658

@@ -662,13 +661,9 @@ func TestUnsafeOperations(t *testing.T) {
662661
t.Fatalf("FilteredSearchUnsafe failed: %v", err)
663662
}
664663

665-
if len(keys) == 0 || keys[0] != 100 {
664+
if len(keys) > 0 {
666665
t.Fatalf("FilteredSearchUnsafe returned incorrect results")
667666
}
668-
669-
if math.Abs(float64(distances[0])) > distanceTolerance {
670-
t.Fatalf("Expected near-zero distance for exact match, got %f", distances[0])
671-
}
672667
})
673668
}
674669

0 commit comments

Comments
 (0)