(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestHeaderHTTPHeader(t *testing.T) { |
| 61 | testcases := map[string]struct { |
| 62 | header Header |
| 63 | expected http.Header |
| 64 | }{ |
| 65 | "basic": { |
| 66 | header: Header{ |
| 67 | "single": []Secret{"v1"}, |
| 68 | "multi": []Secret{"v1", "v2"}, |
| 69 | "empty": []Secret{}, |
| 70 | "nil": nil, |
| 71 | }, |
| 72 | expected: http.Header{ |
| 73 | "single": []string{"v1"}, |
| 74 | "multi": []string{"v1", "v2"}, |
| 75 | "empty": []string{}, |
| 76 | "nil": nil, |
| 77 | }, |
| 78 | }, |
| 79 | "nil": { |
| 80 | header: nil, |
| 81 | expected: nil, |
| 82 | }, |
| 83 | } |
| 84 | |
| 85 | for name, tc := range testcases { |
| 86 | t.Run(name, func(t *testing.T) { |
| 87 | actual := tc.header.HTTPHeader() |
| 88 | if !reflect.DeepEqual(actual, tc.expected) { |
| 89 | t.Fatalf("expecting: %#v, actual: %#v", tc.expected, actual) |
| 90 | } |
| 91 | }) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestHeaderYamlUnmarshal(t *testing.T) { |
| 96 | testcases := map[string]struct { |
nothing calls this directly
no test coverage detected