MCPcopy Index your code
hub / github.com/codesenberg/bombardier / TestHeadersToStringConversion

Function TestHeadersToStringConversion

headers_test.go:7–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestHeadersToStringConversion(t *testing.T) {
8 expectations := []struct {
9 in headersList
10 out string
11 }{
12 {
13 []header{},
14 "[]",
15 },
16 {
17 []header{
18 {"Key1", "Value1"},
19 {"Key2", "Value2"}},
20 "[{Key1 Value1} {Key2 Value2}]",
21 },
22 }
23 for _, e := range expectations {
24 actual := e.in.String()
25 expected := e.out
26 if expected != actual {
27 t.Errorf("Expected \"%v\", but got \"%v\"", expected, actual)
28 }
29 }
30}
31
32func TestShouldErrorOnInvalidFormat(t *testing.T) {
33 h := new(headersList)

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected