(t *testing.T)
| 42 | ` |
| 43 | |
| 44 | func TestParseStatResponse(t *testing.T) { |
| 45 | res, err := parseStatResponse(&http.Response{ |
| 46 | Body: io.NopCloser(strings.NewReader(response)), |
| 47 | }) |
| 48 | if err != nil { |
| 49 | t.Fatal(err) |
| 50 | } |
| 51 | hm := res.HaveMap |
| 52 | res.HaveMap = nil |
| 53 | want := &statResponse{ |
| 54 | HaveMap: nil, |
| 55 | canLongPoll: true, |
| 56 | } |
| 57 | if !reflect.DeepEqual(want, res) { |
| 58 | t.Errorf(" Got: %#v\nWant: %#v", res, want) |
| 59 | } |
| 60 | |
| 61 | if sb, ok := hm["foo-abcd"]; !ok || sb.Size != 123 { |
| 62 | t.Errorf("Got unexpected map: %#v", hm) |
| 63 | } |
| 64 | |
| 65 | if sb, ok := hm["foo-cdef"]; !ok || sb.Size != 999 { |
| 66 | t.Errorf("Got unexpected map: %#v", hm) |
| 67 | } |
| 68 | } |
nothing calls this directly
no test coverage detected