shithub: hugo

Download patch

ref: 9f46a72c7eec25a4b9dea387d5717173b8d9ec72
parent: 9abd396789d007193145db9246d5daf1640bbb8a
author: Bjørn Erik Pedersen <[email protected]>
date: Sun Nov 3 14:41:29 EST 2019

tpl/collections: Add some index map test cases

See #3974

--- a/tpl/collections/index_test.go
+++ b/tpl/collections/index_test.go
@@ -37,6 +37,9 @@
 		{[][]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},