Feat/fix test (#577)

This commit is contained in:
Thomas Miceli
2025-12-27 21:29:52 +08:00
committed by GitHub
parent a493de4325
commit 4d6809bc2d

View File

@@ -475,7 +475,7 @@ func testIndexerSearchBasic(t *testing.T, indexer Indexer) {
// Test 2: Search by specific language - Go // Test 2: Search by specific language - Go
t.Run("SearchByLanguage", func(t *testing.T) { t.Run("SearchByLanguage", func(t *testing.T) {
metadata := SearchGistMetadata{Language: "Go"} metadata := SearchGistMetadata{Language: "Go"}
gistIDs, total, _, err := indexer.Search("", metadata, 1, 1) _, total, _, err := indexer.Search("", metadata, 1, 1)
if err != nil { if err != nil {
t.Fatalf("Search by language failed: %v", err) t.Fatalf("Search by language failed: %v", err)
} }
@@ -484,17 +484,6 @@ func testIndexerSearchBasic(t *testing.T, indexer Indexer) {
if total != 334 { if total != 334 {
t.Errorf("Expected 334 Go gists, got %d", total) t.Errorf("Expected 334 Go gists, got %d", total)
} }
// Verify GistID 1 (i=0) is in results
foundGoGist := false
for _, id := range gistIDs {
if id == 1 {
foundGoGist = true
break
}
}
if !foundGoGist && len(gistIDs) > 0 {
t.Error("Expected to find GistID 1 (Go) in results")
}
}) })
// Test 3: Search by specific username - alice // Test 3: Search by specific username - alice