Skip to content

Commit

Permalink
Merge pull request adnanh#18 from moorereason/extract-tests
Browse files Browse the repository at this point in the history
Add new tests for ExtractParameter
  • Loading branch information
adnanh committed Mar 21, 2015
2 parents 231426d + 943bc25 commit acf38c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hook/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ var extractParameterTests = []struct {
{"a.500.b", map[string]interface{}{"a": map[string]interface{}{"b": "z"}}, "", false}, // non-existent slice
{"a.501.b", map[string]interface{}{"a": []interface{}{map[string]interface{}{"b": "y"}, map[string]interface{}{"b": "z"}}}, "", false}, // non-existent slice index
{"a.502.b", map[string]interface{}{"a": []interface{}{}}, "", false}, // non-existent slice index
{"a.b.503", map[string]interface{}{"a": map[string]interface{}{"b": []interface{}{"x", "y", "z"}}}, "", false}, // trailing, non-existent slice index
{"a.b", interface{}("a"), "", false}, // non-map, non-slice input
}

func TestExtractParameter(t *testing.T) {
Expand Down

0 comments on commit acf38c3

Please sign in to comment.