From 943bc258f79818aa4c19b0c48a852a886ca82907 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Fri, 20 Mar 2015 22:43:39 -0500 Subject: [PATCH] Add new tests for ExtractParameter This commit regains 100% coverage for ExtractParameter after changes from commit 688483d. --- hook/hook_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hook/hook_test.go b/hook/hook_test.go index a799eda..7205a3b 100644 --- a/hook/hook_test.go +++ b/hook/hook_test.go @@ -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) {