(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func 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 | } |
nothing calls this directly
no test coverage detected