Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: improve typo tolerance test
  • Loading branch information
ElyarSadig committed Oct 17, 2025
commit 6fef404c17c0402929e7bdcb519da2f5161d5e6f
33 changes: 32 additions & 1 deletion integration/index_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3354,6 +3354,8 @@ func TestIndex_UpdateTypoTolerance(t *testing.T) {
customMeili := setup(t, "", meilisearch.WithCustomClientWithTLS(&tls.Config{
InsecureSkipVerify: true,
}))
t.Cleanup(cleanup(meili))
t.Cleanup(cleanup(customMeili))

type args struct {
UID string
Expand Down Expand Up @@ -3520,13 +3522,42 @@ func TestIndex_UpdateTypoTolerance(t *testing.T) {
DisableOnNumbers: false,
},
},
{
name: "TestIndexZeroMinWordSizeForTypos",
args: args{
UID: "indexUID",
client: meili,
request: meilisearch.TypoTolerance{
Enabled: true,
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
OneTypo: 0,
TwoTypos: 0,
},
DisableOnWords: []string{},
DisableOnAttributes: []string{},
DisableOnNumbers: true,
},
},
wantTask: &meilisearch.TaskInfo{
TaskUID: 1,
},
wantResp: &meilisearch.TypoTolerance{
Enabled: true,
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
OneTypo: 0,
TwoTypos: 0,
},
DisableOnWords: []string{},
DisableOnAttributes: []string{},
DisableOnNumbers: true,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
setUpIndexForFaceting(tt.args.client)
c := tt.args.client
i := c.Index(tt.args.UID)
t.Cleanup(cleanup(c))

gotTask, err := i.UpdateTypoTolerance(&tt.args.request)
require.NoError(t, err)
Expand Down
Loading