related: Handly []any

See #10624
This commit is contained in:
Bjørn Erik Pedersen
2023-01-17 12:36:34 +01:00
parent 671f64b2eb
commit d595419031
2 changed files with 16 additions and 0 deletions

View File

@@ -212,6 +212,19 @@ func TestToKeywordsToLower(t *testing.T) {
})
}
func TestToKeywordsAnySlice(t *testing.T) {
c := qt.New(t)
var config IndexConfig
slice := []any{"A", 32, "C"}
keywords, err := config.ToKeywords(slice)
c.Assert(err, qt.IsNil)
c.Assert(keywords, qt.DeepEquals, []Keyword{
StringKeyword("A"),
StringKeyword("32"),
StringKeyword("C"),
})
}
func BenchmarkRelatedNewIndex(b *testing.B) {
pages := make([]*testDoc, 100)
numkeywords := 30