summaryrefslogtreecommitdiffstats
path: root/tpl/collections/index_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-21 21:59:38 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-22 18:41:50 +0100
commita3fe5e5e35f311f22b6b4fc38abfcf64cd2c7d6f (patch)
tree06cf1f647ae026b4fb3053c85370c2b203c7a089 /tpl/collections/index_test.go
parentcd07e6d57b158a76f812e8c4c9567dbc84f57939 (diff)
Fix Params case handling in the index, sort and where func
This means that you can now do: ``` {{ range where .Site.Pages "Params.MYPARAM" "foo" }} ```
Diffstat (limited to 'tpl/collections/index_test.go')
-rw-r--r--tpl/collections/index_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/tpl/collections/index_test.go b/tpl/collections/index_test.go
index c4cded47c..0c380d8d5 100644
--- a/tpl/collections/index_test.go
+++ b/tpl/collections/index_test.go
@@ -17,6 +17,8 @@ import (
"fmt"
"testing"
+ "github.com/gohugoio/hugo/common/maps"
+
qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/deps"
)
@@ -42,7 +44,8 @@ func TestIndex(t *testing.T) {
{[]map[string]map[string]string{{"a": {"b": "c"}}}, []interface{}{0, "a", "b"}, "c", false},
{map[string]map[string]interface{}{"a": {"b": []string{"c", "d"}}}, []interface{}{"a", "b", 1}, "d", false},
{map[string]map[string]string{"a": {"b": "c"}}, []interface{}{[]string{"a", "b"}}, "c", false},
-
+ {maps.Params{"a": "av"}, []interface{}{"A"}, "av", false},
+ {maps.Params{"a": map[string]interface{}{"b": "bv"}}, []interface{}{"A", "B"}, "bv", false},
// errors
{nil, nil, nil, true},
{[]int{0, 1}, []interface{}{"1"}, nil, true},