Skip to content

Commit

Permalink
tpl/collections: Add some index map test cases
Browse files Browse the repository at this point in the history
See #3974
  • Loading branch information
bep committed Nov 4, 2019
1 parent 9abd396 commit 9f46a72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tpl/collections/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 9f46a72

Please sign in to comment.