mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-22 02:11:12 +00:00
chore(dep): Update module meilisearch to v0.33 (#8788)
Fixes the breakages with the version update... Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8788 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com> Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
parent
6faaf807ff
commit
a1dd77d115
4 changed files with 32 additions and 33 deletions
|
@ -46,30 +46,34 @@ func TestMeilisearchIndexer(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestConvertHits(t *testing.T) {
|
||||
_, err := convertHits(&meilisearch.SearchResponse{
|
||||
Hits: []any{"aa", "bb", "cc", "dd"},
|
||||
})
|
||||
require.ErrorIs(t, err, ErrMalformedResponse)
|
||||
for _, invalidID := range []string{"\"aa\"", "{\"aa\":\"123\"}", "[\"aa\"]"} {
|
||||
_, err := convertHits(&meilisearch.SearchResponse{
|
||||
Hits: meilisearch.Hits{
|
||||
meilisearch.Hit{"id": []byte(invalidID)},
|
||||
},
|
||||
})
|
||||
require.ErrorIs(t, err, ErrMalformedResponse)
|
||||
}
|
||||
|
||||
validResponse := &meilisearch.SearchResponse{
|
||||
Hits: []any{
|
||||
map[string]any{
|
||||
"id": float64(11),
|
||||
"title": "a title",
|
||||
"content": "issue body with no match",
|
||||
"comments": []any{"hey what's up?", "I'm currently bowling", "nice"},
|
||||
Hits: meilisearch.Hits{
|
||||
meilisearch.Hit{
|
||||
"id": []byte("11"),
|
||||
"title": []byte("\"a title\""),
|
||||
"content": []byte("\"issue body with no match\""),
|
||||
"comments": []byte("[\"hey what's up?\", \"I'm currently bowling\", \"nice\"]"),
|
||||
},
|
||||
map[string]any{
|
||||
"id": float64(22),
|
||||
"title": "Bowling as title",
|
||||
"content": "",
|
||||
"comments": []any{},
|
||||
meilisearch.Hit{
|
||||
"id": []byte("22"),
|
||||
"title": []byte("\"Bowling as title\""),
|
||||
"content": []byte("\"\""),
|
||||
"comments": []byte("[]"),
|
||||
},
|
||||
map[string]any{
|
||||
"id": float64(33),
|
||||
"title": "Bowl-ing as fuzzy match",
|
||||
"content": "",
|
||||
"comments": []any{},
|
||||
meilisearch.Hit{
|
||||
"id": []byte("33"),
|
||||
"title": []byte("\"Bowl-ing as fuzzy match\""),
|
||||
"content": []byte("\"\""),
|
||||
"comments": []byte("[]"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue