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>2019-11-03 21:41:29 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-04 13:13:27 +0300
commit9f46a72c7eec25a4b9dea387d5717173b8d9ec72 (patch)
treeca18fe06a674e1a6880d66fb2f89cd27ff564876 /tpl/collections
parent9abd396789d007193145db9246d5daf1640bbb8a (diff)
tpl/collections: Add some index map test cases
See #3974
Diffstat (limited to 'tpl/collections')
-rw-r--r--tpl/collections/index_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tpl/collections/index_test.go b/tpl/collections/index_test.go
index fdc66a0ae..6e9071aba 100644
--- a/tpl/collections/index_test.go
+++ b/tpl/collections/index_test.go
@@ -37,6 +37,9 @@ func TestIndex(t *testing.T) {
{[][]int{{1, 2}, {3, 4}}, []interface{}{0, 0}, 1, false},
{map[int]int{1: 10, 2: 20}, []interface{}{1}, 10, false},
{map[int]int{1: 10, 2: 20}, []interface{}{0}, 0, false},
+ {map[string]map[string]string{"a": {"b": "c"}}, []interface{}{"a", "b"}, "c", false},
+ {[]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},
// errors
{nil, nil, nil, true},
{[]int{0, 1}, []interface{}{"1"}, nil, true},