Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-21 18:44:48 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-21 18:46:26 +0300
commit27af5a339a4d3c5712b5ed946a636a8c21916039 (patch)
tree8ca43ae76bf3fd89f4d9a5a425b93320bda6532e /related/inverted_index_test.go
parentb3c825756f3251f8b26e53262f9d6f484aecf750 (diff)
related: Fix toLower
Don't change the slice. Fixes #7198
Diffstat (limited to 'related/inverted_index_test.go')
-rw-r--r--related/inverted_index_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/related/inverted_index_test.go b/related/inverted_index_test.go
index 57e722364..576928aea 100644
--- a/related/inverted_index_test.go
+++ b/related/inverted_index_test.go
@@ -201,6 +201,21 @@ func TestSearch(t *testing.T) {
}
+func TestToKeywordsToLower(t *testing.T) {
+ c := qt.New(t)
+ slice := []string{"A", "B", "C"}
+ config := IndexConfig{ToLower: true}
+ keywords, err := config.ToKeywords(slice)
+ c.Assert(err, qt.IsNil)
+ c.Assert(slice, qt.DeepEquals, []string{"A", "B", "C"})
+ c.Assert(keywords, qt.DeepEquals, []Keyword{
+ StringKeyword("a"),
+ StringKeyword("b"),
+ StringKeyword("c"),
+ })
+
+}
+
func BenchmarkRelatedNewIndex(b *testing.B) {
pages := make([]*testDoc, 100)