MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestParseMeilisearchHits

Function TestParseMeilisearchHits

internal/retrieval/http_kb_test.go:68–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestParseMeilisearchHits(t *testing.T) {
69 raw := `{
70 "hits": [
71 {"id": "x", "text": "hello", "_rankingScore": 0.99},
72 {"id": "y", "body": "there"}
73 ]
74}`
75 res, err := parseMeilisearchHits([]byte(raw))
76 if err != nil {
77 t.Fatal(err)
78 }
79 if len(res.Chunks) != 2 || res.Chunks[0].Text != "hello" || res.Chunks[1].Text != "there" {
80 t.Fatalf("%+v", res.Chunks)
81 }
82}

Callers

nothing calls this directly

Calls 1

parseMeilisearchHitsFunction · 0.85

Tested by

no test coverage detected